Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14671

Joomla 3.3 & CiviCRM 4.4.4 / JRegistry fatal PHP error during cron run

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.4, 4.4.5
    • Fix Version/s: 4.5
    • Component/s: None
    • Labels:
      None

      Description

      After upgrading to Joomla 3.3, I now receive the following error from PHP when attempting to run cron jobs via the CLI:

      "PHP Fatal error: Class 'JRegistry' not found in <site root>/libraries/joomla/factory.php"

      This same error occurs when running it using <mysite>/administrator/components/com_civicrm/civicrm/bin/cron.php?name=someuser&pass=somepass&key=somekey .

      The issue has been resolved by adding a few lines to /administrator/components/com_civicrm/civicrm/CRM/Utils/System/Joomla.php .

      Towards the bottom of this file is a function called 'loadJoomlaBootstrap' where you will find this block of code:

      // Get the framework.
      if (file_exists($joomlaBase . '/libraries/import.legacy.php'))

      { require $joomlaBase . '/libraries/import.legacy.php'; }

      Add another block underneath that to include <root>/libraries/cms.php from the Joomla framework:

      if (file_exists($joomlaBase . '/libraries/cms.php'))

      { require $joomlaBase . '/libraries/cms.php'; }

      This is the file that contains pointers from the old legacy classes that Civi uses, to the new classes used by J3.3. This is a hack, and Civi really needs to be updated to use the new classes, but this works for now - in the medium term. Those legacy pointers will likely get removed at some point.

      I should also note that I have personally tested this fix only on 4.4.5, though it would likely solve it on 4.4.4 as well.

      There's a discussion on this at http://forum.civicrm.org/index.php/topic,32620.msg139188.html .

        Attachments

          Activity

            People

            • Assignee:
              jproffitt Jeremy Proffitt
              Reporter:
              plethoradesign Casper Voogt
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: