2

After upgrading Joomla to 3.8.1 the cron job stopped working as reported here. I have applied the update the Joomla.php file as suggested in the answers. This gets rid of the original error. However now I am getting this error: PHP Notice: Constant JPATH_ISWIN already defined in /home/fava/public_html/libraries/import.legacy.php on line 64 Notice: Constant JPATH_ISWIN already defined in /home/fava/public_html/libraries/import.legacy.php on line 64 PHP Notice: Constant JPATH_ISMAC already defined in /home/fava/public_html/libraries/import.legacy.php on line 65 Notice: Constant JPATH_ISMAC already defined in /home/fava/public_html/libraries/import.legacy.php on line 65 PHP Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.legacy.php on line 72 Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.legacy.php on line 72 PHP Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.legacy.php on line 79 Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.legacy.php on line 79 PHP Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.php on line 60 Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.php on line 60 PHP Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.php on line 67 Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.php on line 67 Error displaying the error page: Application Instantiation Error: Failed to start the session because headers have already been sent by "/home/fava/public_html/libraries/import.legacy.php" at line 64.

I have tried manually clearing the Joomla session table but no luck. I have also update CiviCRM to 4.7.27 and applied the patches as mentioned here but the same error is still occurring.

4
  • I've just tested this again and I'm not convinced that the patch for CRM-21203 works for cron jobs that call cron.php, only cli.php. Your output looks as though you are using cron.php; as a workaround you could try having the cron job execute php /path/to/civicrm/bin/cli.php -s site -u user -p password -e Job -a execute Note: I am also getting the PHP notices for constant already defined but they do not stop the job running via cli.php. Commented Nov 6, 2017 at 11:42
  • Thanks Andrew, I am getting the errors using cli.php so I decided to change to cron.php and the cron job is now executing, not all the the jobs are running properly but atleast the we are starting to get somewhere
    – Ash Lock
    Commented Nov 7, 2017 at 22:51
  • I should mention that for me even using cli.php there are still Notices, but the scheduled jobs run properl. But with cli.php I don't the Application Instantiation Error at the end - I only get that with cron.php. Commented Nov 8, 2017 at 23:23
  • I think there are still problems on CiviCRM 4.7.28. I've added to the existing issue here Commented Jan 2, 2018 at 14:12

2 Answers 2

1

I have updated Joomla to 3.8.5 and updated CiviCRM to 4.7.31 (I'm using PHP version 5.6.34.) and the CRON job still didn't work.

I found and applied this patch and it worked. Thank you to Andrew Thompson for your work on this issue.

0

It looks like import.legacy.php is re-definining existing constants (or called twice)

I'm not familiar with Joomla, but can you try to remove requiring this file in civi (comment out line 565 in that file)

https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Joomla.php#L565

1
  • There are still some problems in CRM/Utils/System/Joomla.php. When I was looking at CRM-21203 I did notice that CiviCRM should not be requiring both of Joomla's import.php and import.legacy.php as the content of import.php is really a subset of import.legacy.php But there is still something else that stops cron.php working. Commented Nov 6, 2017 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.