-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
DRAFT: Fix/environment loader #4617
base: main
Are you sure you want to change the base?
Conversation
@sreichel Please see this PR. |
Quick test. 404 one every page. |
Maybe it come from invalid setting .... ?
|
For reference my old config:
With yours I am getting infinite loop. |
The error was caused by the via 1f6b7ed |
Thanks for working on it. Cant make a PR to your repo right now ... how about to filter env vars in getEnv()? public function getEnv(): array
{
if (is_null($this->envStore)) {
$env = getenv();
$env = array_filter($env, function ($key) {
return str_starts_with($key, self::ENV_STARTS_WITH);
}, ARRAY_FILTER_USE_KEY);
$this->envStore = $env;
}
return $this->envStore;
} Maybe add an additional check for env |
Yes, on default scope, but not on one website/storeview level. (Scope label should ben changed to "ENV") |
Note ... Tests should be updated. |
1f6b7ed
to
9072ff8
Compare
In "Default" scope the attribute is locked. For "German" storeview its not.
No, not that other "label". :) "[STORE VIEW]" could change to "[ENV]" and the checkbox can be removed. I am busy for the next 2-3 days. I'll test ASAP. |
Hm. For me its locked.
Gotcha. Good point. |
Not sure about it, sorry. Maybe the disabled checkbox was missleading. (?) |
Great! ❤️ I can make a PR later, but if you have time for it, please check the red SonarCloud issues. |
I've removed one case. I'm not sure how else to get there (without makeing the cache array public?) |
To pass the complexity-check it should be enough to move try/catch-parts to a seperate method. Leave it as it is, i'll add a PR later. PS: please |
:/ |
Hehe, that may be the only thing ... have you tested code-coverage for all new methods?
Idea only ....
Will test as soon i am back. |
Co-authored-by: Sven Reichel <[email protected]>
Co-authored-by: Sven Reichel <[email protected]>
Co-authored-by: Sven Reichel <[email protected]>
Co-authored-by: Sven Reichel <[email protected]>
Co-authored-by: Sven Reichel <[email protected]>
Co-authored-by: Sven Reichel <[email protected]>
ed1bd01
to
de18a5d
Compare
|
Description (*)
This PR attempts to fix the incomplete attempt for config values to be overwritten from ENV variables.
Related Pull Requests
Fixed Issues (if relevant)
Relates to issue #4257 (comment)
Manual testing scenarios (*)
Mage::getStoreConfig
.Automated tests:
ddev phpunit --group Mage_Core_EnvLoader
Questions or comments
Please give feedback to this WIP solution.
Maybe in the future we can add a reasoning of "why" the field in the backend is disabled for edits. Such as give a "warning" sign and show that this field is overwritten by a environment variable.
I feel that this is out of scope for now, for I think that the feature should first work the best it can.
Contribution checklist (*)