-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Don't try to merge array with null #13090
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How $currentData equal to null passes condition in line 131?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the description wording to use "not an array".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the static analysis complains. I guess I'll move the condition up to 131.
4945974 to
5091a40
Compare
Could you provide exact steps please? First you mentioned there could be |
|
Ping @cedricziel :) |
|
Oh! Well, yeah. So... I think there was something wrong with existent but empty config files in terms of a shared config file through deployer. I consider this fix valid nevertheless since an empty config file is still present (but no array though). |
it was checking for emptiness before your change. So, can situation you described happen in normal circumstances and how? Before applying any fix QAs need to check issue actually occurs on current stable release. |
|
I admit this might be an edge case, but better play it safe, no? |
|
@cedricziel I may be wrong but proposed logic hides problem as to me. So it is a good thing to notify user there is a problem with Although, if there is a real-world scenario with such edge case, it needs to be fixed. Let's concentrate on producing exact steps to reproduce first. So, somehow in |
|
@cedricziel please provide more details, if possible, so that issue can be reproduced on mainline. |
|
I'll close this for now - unfortunately I don't have time for this currently. |
|
I just ran into this as well.. Same error, same fix. |
|
@barryvdh can you elaborate steps to reproduce maybe? This proposed change looks more as a workaround than a proper fix. |
|
I created a working version on my development machine. Then did a checkout on a different machine and ran the install script ( I have the modules committed in config.php, but nothing else. Unfortunately I now realize I'm on 2.2.0, so I cannot really confirm this is still in 2.2.2. |
|
@barryvdh no problem with 2.2.0 as this line does not seem to be changed in 2.2.2. Could you please
today or tomorrow. |
|
I just setup a new store, same issue. Steps:
Result:
|
|
In my constellation (with deployer as deployment workflow tool) the config file was initially created empty, since there was none and that produced the issue - i think it's perfectly sane to assume that the config can be empty and anticipate it accordingly (my 2ct). |
|
Okay I figured it out, my deployment system registers symlinks for I can kinda see this is an issue with the deployment setup, but it would be an easy fix to check in the DeploymentConfig Reader to see if it's an actual result, otherwise return false. |
|
I created a Pull Request for this. Similar to this PR, but I think that will handle it at the root of the problem; the Reader. That will prevent issues in other places also. |
|
Much better, thx @barryvdh . |
|
It might be better to handle this at Deployer perhaps? deployphp/deployer#1540 |
Description
When starting the installer the first time, the current config provided to the deployment config writer is not an array, thus
array_replace_recursiveemits a warning. With a stricter error handler this will be converted to an exception which prevents running the installer entirely.This change fixes the behaviour by checking if the current config is present and resumes operation with the already initialized factory config.