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) »
  • Upgrade error found in Drupal civicrm_initialize
Pages: [1]

Author Topic: Upgrade error found in Drupal civicrm_initialize  (Read 577 times)

Max Scott

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 7.15
  • MySQL version: 5.1
  • PHP version: 5.3.8
Upgrade error found in Drupal civicrm_initialize
August 13, 2012, 02:41:41 pm
I have been receiving a 'Page not found' error whenever I have attempted to use the upgrade script http://<your_drupal_home>/civicrm/upgrade?reset=1. I have traced this to a possible issue in the civicrm_initialize method in the civicrm_module file in the drupal directory.
The original version of lines 349 to 355 is
if ((!isset($args[1]) OR $args[1] != 'upgrade') &&
      (method_exists('CRM_Core_BAO_Preferences', 'value') && CRM_Core_BAO_Preferences::value('editor_id') == 4)
      || (method_exists('CRM_Core_BAO_Setting', 'getItem') && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
          // drupal wysiwyg
          'editor_id'
        ) == 4)
    ) {

I have added brackets around the conditions following the first occurrence of && so that it now reads:
if ((!isset($args[1]) OR $args[1] != 'upgrade') &&
      ((method_exists('CRM_Core_BAO_Preferences', 'value') && CRM_Core_BAO_Preferences::value('editor_id') == 4)
      || (method_exists('CRM_Core_BAO_Setting', 'getItem') && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
          // drupal wysiwyg
          'editor_id'
        ) == 4))
    ) {

The upgrade script now works.
Does anyone know if the original really does have an error?

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: Upgrade error found in Drupal civicrm_initialize
August 14, 2012, 01:43:44 pm

i checked both v4.2 and v4.1 and it does seem to have the paranthesis right

can u check the svn repo here:

http://svn.civicrm.org/civicrm/branches/v4.2/drupal/civicrm.module
http://svn.civicrm.org/civicrm/branches/v4.1/drupal/civicrm.module

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

Max Scott

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 7.15
  • MySQL version: 5.1
  • PHP version: 5.3.8
Re: Upgrade error found in Drupal civicrm_initialize
August 14, 2012, 02:39:42 pm
The parenthesis has been corrected in v4.2

    if (
   (!isset($args[1]) || $args[1] != 'upgrade') &&
   ((method_exists('CRM_Core_BAO_Preferences', 'value') &&
     CRM_Core_BAO_Preferences::value('editor_id') == 4)
    || (method_exists('CRM_Core_BAO_Setting', 'getItem') &&
        CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
                  // drupal wysiwyg
                  'editor_id'
                  ) == 4)
    )
   ) {


but not in v4.1

    if ((!isset($args[1]) OR $args[1] != 'upgrade') &&
      (method_exists('CRM_Core_BAO_Preferences', 'value') && CRM_Core_BAO_Preferences::value('editor_id') == 4)
      || (method_exists('CRM_Core_BAO_Setting', 'getItem') && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
          // drupal wysiwyg
          'editor_id'
        ) == 4)
    ) {


Regards\Max

Max Scott

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.1.5
  • CMS version: Drupal 7.15
  • MySQL version: 5.1
  • PHP version: 5.3.8
Re: Upgrade error found in Drupal civicrm_initialize
August 15, 2012, 01:18:14 pm
Have created this as a new bug issue in the Issue Tracker

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: Upgrade error found in Drupal civicrm_initialize
August 15, 2012, 01:19:23 pm

thanx for filing an issue. We'll fix this for 4.1.6

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade error found in Drupal civicrm_initialize

This forum was archived on 2017-11-26.