-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
Fix php 7.2+ deprecation error #15178
Conversation
(Standard links)
|
I think that looks right to me |
The patch looks sensible, but in php 7.3, WP 5.2.2, CiviviCRM master without the patch: calling cli.php works fine. I did not get any errors in my php logs and as I had call Command used After the patch was applied, I ran the same command and received a cryptic message:
Reverting the patch and cli.php runs properly. Perhaps there is a flaw in how i am testing. Any ideas? |
By default the error_reporting() value doesn't often include E_DEPRECATED so you won't see the message. I can reproduce it if I add E_DEPRECATED to error_reporting(). For the patch, the letter 'c' is appearing because $var[1] is the second letter in 'action': Suggest to change |
@demeritcowboy i believe wordpress by default turns on E_ALL for error_reporting |
@seamuslee001 Ok I admit I was using drupal but when I echo'd error_reporting() at the line just before the each() it said 1 (E_ERROR) only, which now that I think more about it must be set somewhere in civi because that's not my setting or drupal's. But then how did the original person see it. Hmmm. |
& with @demeritcowboy code So yes Dave nailed figuring out what the crufty old code was trying to say - I will update & merge (treating myself as the review of @demeritcowboy's suggested code change) |
@eileenmcnaughton Some extra contribution-related code seems to have snuck into the patch? |
@demeritcowboy Good pickup. I'll test again and not include that |
did an |
OK - removed the extra - I had created a local 'origin/master' branch & rebased over that not the remove tracking branch - merging now |
Overview
FIxes
The each() function is deprecated. This message will be suppressed on further calls in /var/www/sln/wordpress/wp-content/plugins/civicrm/civicrm/bin/cli.class.php on line 298"
from wp cli
Before
Error on php 7.2+
After
No error
Technical Details
@kcristiano @seamuslee001 I haven't tested this - it's just off chat but I think this is the syntax for getting rid of each
Comments