-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug: WP_ENVIRONMENT_TYPE set doesn't check if constant is already defined #672
Comments
What is the actual error? |
Local has this file auto-prepended via PHP to all sites:
|
We had this issue too, but since this covers the variable in all our use cases, I've just gone and removed our manually setting of this config variable. However I'm also interested in understanding the thinking behind "!env('WP_ENVIRONMENT_TYPE')" |
It seems like May I suggest the deprecation of
|
The intent was for Bedrock to only set I'd prefer to just fix this issue before re-evaluating I think the solution should only check |
Maybe relevant to know: Wordpress 6.3 will introduce a new https://make.wordpress.org/core/2023/07/14/configuring-development-mode-in-6-3/ |
Terms
Description
What's wrong?
Some environments (like Local) set the
WP_ENVIRONMENT_TYPE
constant. Bedrock's implementation should probably check for that to avoid a fatal error.What have you tried?
Local's prepended PHP file can be updated, but a more bulletproof implementation here is likely preferred.
Possible solutions
I'm also not sure what the
!env('WP_ENVIRONMENT_TYPE')
check does in that line, since there's no code to convert that exact env value to the constant value, unless WordPress is doing it under the hood (it might be).Temporary workarounds
Update Local's config
Steps To Reproduce
Expected Behavior
No fatal error
Actual Behavior
Fatal error
Relevant Log Output
No response
Versions
Since PR #668
The text was updated successfully, but these errors were encountered: