New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21203 revisited - Joomla 3.8 extra fixes for cli.php #11609
CRM-21203 revisited - Joomla 3.8 extra fixes for cli.php #11609
Conversation
Can one of the admins verify this patch? |
Jenkins add to whitelist |
1 similar comment
Jenkins add to whitelist |
@lcdservices Tagging you as a Joomla user :-) Let me know if you get chance to comment on this patch |
A bit more to add. This is regarding the warning & error that still remain, namely:
In This applies to I found that either of the following will stop the warning & error and let cron.php run normally:
Question: is it correct for CiviCRM to be doing a PHP |
In my development environment (MacOS) this PR fixed the Notices and Errors I had after (test-) upgrading from 4.7.23 to 4.7.30:
So should I upgrade my production system and add this patch, or will that come back and haunt me when I upgrade to 4.7.31? ;-) |
@thoni56 Did it fix both cron.php and cli.php? Did you remove |
I only tried it with cli.php as that is what we use. I'll test it with cron.php too. NB I ran the command from a terminal, not actually through cron. I only applied the patch, nothing else. |
No, it didn't solve the cron.php case:
But removing "session_start()" from line 127 in CRM/Core/Session.php did the trick for cron.php. |
I also found that essentially the same problem as cron.php also occurs with REST.
With this one it's the |
ping @totten you know a thing or two about the interaction between CiviCRM and the CMS in regards to bootstrapping |
I suggest that this PR is merged as is, without delaying the solution for many, waiting for a fix for the REST problem (#11609 (comment)). As it stands, possibly including the deletion of "session_start()" (#11609 (comment)), it fixes issues for users (as in this question on civicrm.stackexchange.com. |
@thoni56 Regarding |
I've unmarked as 'WIP' following Brian's comment on JIRA. |
@andrewpthompson FWIW -- I tested on my dev site and switched between PHP5.6 and PHP7.0 and it worked properly on both when run via cron.php. I was only testing cron.php, as it seemed that was the potential outstanding issue. So if others are finding it's not running, it may be another factor besides the version. |
Reading the comments I feel like there is general agreement to merge this & that it fixes an identifiable problem without any identified problems. The issue is narrowly scoped to affecting Joomla! and I think the people who know Joomla! best have indicated support for this - so I'm going to merge |
Thanks everyone for the fixes. The warning was still shown after applying the various fixes, but the cron now runs using PHP 7.1 and CiviCRM 5.1.2. Through debugging cron.php, I found the wrong time zone was contributing to the issue, even though it was set correctly in Joomla, the master php configuration and on the server. Just wanted to note here incase someone else has the issue and the fixes above don't fully resolve the issue. |
Overview
Several Joomla 3.8 users have reported that their scheduled jobs do not run via cron.php or cli.php. The patch for CRM-21203 has not resolved this for them.
See my comment on CRM-21203 for more background.
This patch as it stands only partly resolves the PHP notices/warning/error that stops cron jobs running in some PHP environments.
Before
cli.php will output several notices. In my PHP 7.0 test environment it failed, but on PHP 5.6 it still runs.
Running cron.php is similar. See my comment on CRM-21203.
After
Running cli.php produces no PHP notices, warnings or errors.
This patch still doesn't resolve cron.php's warning/error so far - not sure what needs to be done to fix that.
Technical Details
Made less of the requires apply to Joomla 3.8. See Joomla 3.8's own cli scripts. They require/import fewer files than
CiviCRM's CRM_Utils_System_Joomla::loadBootStrap
does. For example, Joomla'scli/garbagecron.php
will load onlyincludes/defines.php
,libraries/import.legacy.php
andlibraries/cms.php
. Andcli/finder_indexer.php
loads those plus configuration.php.Comments
Help needed please. We still need to find a solution for cron.php, which will still produce a warning and an error (depending on PHP version & environment):
Otherwise it works for my scheduled jobs but I'm not certain if there will be other consequences from removing the includes so assistance is needed with testing.