Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Critical
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.1.5
-
Fix Version/s: 4.1.6
-
Component/s: Drupal Integration Modules
-
Labels:
Description
When upgrading from 4.1.3 to 4.1.5 I have experienced a 'Page not found error' on some of my websites. I traced the issue to the civicrm_initialize function in the civicrm.module in the drupal directory. Checking through the coding, I identified a possible logic error in the following IF statement:
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) ) { |
---|
It would appear that the statement block belonging to this IF statement should not be executed if one is doing an upgrade. However, the || operator divides the conditions into two parts. Only the first part involves testing whether an upgrade is being done. The second part may well return the value TRUE even though an upgrade is being done, and consequently the statement block will be executed.
What is required is that conditions following the the first occurrence of the && operator be enclosed in parenthesis. This will ensure that the statement block will not be executed when an upgrade is being done.
I would also suggest that the OR operator be changed to ||. Mixing the two forms of these logical operators can create a logical headache because of their different levels of precedence.
All of these changes have been made in v4.2 but have yet to be made in v4.1.