-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
bin/*, extern/* - Fix leak of "$config" in global namespace #16702
Conversation
(Standard links)
|
What's the best way to test this? I assume it has to be merged before it can be tested with automated tests with Backdrop. Seems like it needs to be tested first locally. |
@herbdool the simplest way to test this would be to check it out locally then from within the main CiviCRM folder run `./tools/scripts/phpunit 'E2E_Extern_RestTest' and see that the test Rest examples work. The other thing you could try is just deploying it locally and creating a test mailing or something with some images and links and check the tracked opens and etc urls work correctly |
Overall 👍 . Adding some supporting detail:
$GLOBALS['config '] instanceof CRM_Core_Config While it's hard to perfectly rule out the existence of such code, I'm not too concerned about it. Why? Two reasons:
I also think this patch is doing the Right Thing because it still calls |
The E2E suite provides coverage of some |
…th backdrop
Overview
This removes the $config variable from some pre CMS boot locations to avoid issues with backdrop comparability
Before
When using a
bin/
orextern/
script, the$config
variable implicitly enters the global namespace.Rest API tests fail on current Backdrop
1.x
builds because Backdrop specifies its ownglobal $config
of typearray
.After
Rest API tests pass again on backdrop
Technical Details
Backdrop recently made $config a global variable and its probable that our use of $config in these files whilst not declared global maybe caused to populate when backdrop is booted
ping @totten @herbdool