CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id
Pages: 1 [2]

Author Topic: Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id  (Read 7089 times)

acrosman

  • Guest
Re: Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id
March 06, 2008, 09:32:48 am
I did.  Well, to be fair, the first time I tried it today I forgot, and the update failed on step 2.  Just to be safe, I re-ran it again just now, and it again failed on step 6.  I'd be happy to take the blame, but I don't THINK I've screwed it up.

Sorry,
Aaron
« Last Edit: March 06, 2008, 10:03:14 am by acrosman »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id
March 06, 2008, 12:56:16 pm

can u try the following fix:

CRM/Utils/File.php, line 263:

replace

Code: [Select]
            //get rid of comments starting with # and --
            $string = ereg_replace("\n#[^\n]*\n", "\n", $string );
            $string = ereg_replace("\n\-\-[^\n]*\n", "\n", $string );

with

Code: [Select]
            //get rid of comments starting with # and --                                                                     
            $string = preg_replace("/^#[^\n]*$/m", "\n", $string );                                                         
            $string = preg_replace("/^\-\-[^\n]*$/m", "\n", $string );                                                       

I suspect this will work and does a better job getting rid of comments :) Can you please post back and i'll file an issue and commit :)

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

acrosman

  • Guest
Re: Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id
March 07, 2008, 06:26:26 am
That seems to work, although I had to run through the process twice.  First time it failed on step 3, I rebuilt the database and tried again, just to be sure, and it worked.  I'm not sure what was different the first time (I literally reran the exact same commands during the rebuild).  But at least I can now go on happily testing the rest of the upgrade.

Aaron

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id
March 07, 2008, 08:45:56 am
With beta5 release and following 1.9 db fix schema, mine worked happily through. I did not have to do what lobo suggested; the new beta cleared it all up. thanks!

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error upgrading 1.9 to 2.0 -> foreign key constr. fails on activity_type_id

This forum was archived on 2017-11-26.