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
Error with Backdrop/CiviCRM automated tests: overrides checking for arrays and objects #4334
Comments
@herbdool .@totten and I are also exploring exactly why our CRM_Core_Config option is getting checked by Backdrop as well (we think that its likely due to the fact that for the rest method we have already prepopulated the $config variable https://github.com/civicrm/civicrm-core/blob/master/extern/rest.php#L13 before booting backdrop |
@seamuslee001 yeah, odd. Is this a new issue? The override was just merged into Backdrop so I wonder if something was introduced with it. |
basically @herbdool the override specifies that $config variable is now global where was it wasn't before so when we were calling $config previously it wasn't interfering with any backdrop code as a) it had no knowledge of a thing called $ config and b) it wasn't in the global space where as backdrop calls it global now |
Right. Now A problem with your PR is that we don't want to include anything that CiviCRM created in the overrides variable since it could be used elsewhere like:
Though I suppose someone would need to call with the key. |
@herbdool @totten I have created civicrm/civicrm-core#16702 to try to remove our usage of $config in some pre cms boot locations which i think might also solve the problem perhaps |
@seamuslee001 thanks, I'll take a look. How about the PR here? Should we close it for now? If we keep it I've recommended a change. |
@herbdool i think its still potentially useful given from backdrop's POV if something has tampered with $config turning it into an object then it should at the very least silently ignore the thing IMO |
This could be viewed as a philosophical trade-off between strict and forgiving behaviors:
As a personal/philosophical matter, I tend to favor strict approaches. But it's also legit to trace out the practical impacts and see if those are signficiant. Here are a few thoughts/expectations:
|
@totten I guess we'll go with Forgiving with this PR :) |
Just a tiny nit with coding standards (single-line comment beyond 80chars) + also suggested using punctuation. Once that's fixed, this can go back to RTBC 😉 |
Thanks @totten, @seamuslee001, and @herbdool! So the fix seems adequate and I'm fine with discarding the unexpected input in this scenario. I'd like see the discarding done further up so that when we parse settings.php, if |
I'm moving this to the minor milestone (1.16.0) candidate because the code for config overrides is only in 1.x and not in the current 1.15.x releases. |
Reported from @seamuslee001 here backdrop/backdrop#3093:
Fatal error: Uncaught Error: Cannot use object of type CRM_Core_Config as array in /home/jenkins/bknix-max/build/build-1/web/core/includes/config.inc on line 457 Error: Cannot use object of type CRM_Core_Config as array in /home/jenkins/bknix-max/build/build-1/web/core/includes/config.inc on line 457
PR: backdrop/backdrop#3093 by @seamuslee001
The text was updated successfully, but these errors were encountered: