-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Too many PHP Warning related to Switch - Continue PHP statement #7843
Comments
Two of them are in vendor, so we can't directly edit that. I changed the one in the core though: #7845 |
Fixed in 2.16.0, release coming soon. |
We didn't see these warnings before on 2.15.3 but after upgrading to 2.16.0 the two in vendor started to appear on every Cron run. How can this be solved without turning of PHP Warnings?
|
@online-expert according to the comment above from @Woeler (#7843 (comment)) there are two which relate to vendors where we are not able to make changes. The one which related to Mautic core was resolved with #7845. @dennisameling any thoughts on this? |
Found this PR which seemed to address this in the Doctrine GH repo in case it's of any help: doctrine/orm#7325 |
Manually replacing 'continue' into 'break' on the two lines in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php made the PHP Warnings go away for now but how does this code in vendor directories of Mautic gets updated? |
Did some more checks. We already have a fix for this in our "patches": {
"doctrine/orm": {
"#6991 Support PHP 7.3 without dropping support for 5.6/7.0": "https://github.com/doctrine/doctrine2/commit/07fc401d255a4cdb4a557147d1c8a3fc7a0c718d.diff"
}
} When I check out the This made me realize that something in our build scripts (the scripts that package Mautic for release versions) causes the patch to not be applied in our release package. I found this line in the build script: When I run the command manually, the patch is indeed not applied. But when I remove the
TL;DR
Thanks for reporting this bug! |
This issue has been mentioned on Mautic Community Forums. There might be relevant details there: |
Great work @dennisameling thanks for tracking down the 🐛 ! |
Good catch @dennisameling I regret having to use that patching method. Hopefully we can avoid it in the future. |
I have spend an entire day trying to get this software up and running. All the solutions on this thread didnt work for me. It is a great software but I have moved on now. |
After long hours of going through the workarounds, I fixed my issue by removing all files, installed an old version and upgrading it from the dashboard to the recent version. It is working fine now. |
We can't simply remove the |
Found a way to fix this issue. We can't get composer to run plugin scripts manually (cweagans/composer-patches in this case, which applies patches) without also triggering other scripts in our composer.json. So, I added the patched |
Bug Description
1690 lines of PHP Warning appeared in the log file from 14:10 to 20:00 related to Switch statement and Continue.
This is far from ideal because you have to turn off the PHP Warning if you want to operate the system, so many messages are generated.
Every Cron run creates all of these 3 PHH Warnings.
Steps to reproduce
Log errors
How to handle?
By the documentation:
Note: In PHP the switch statement is considered a looping structure for the purposes of continue. continue behaves like break (when no arguments are passed). If a switch is inside a loop, continue 2 will continue with the next iteration of the outer loop.
It would be useful decide what was the original intent of the author of this part of code:
use Break or Use Continue with 2 or 3.
The text was updated successfully, but these errors were encountered: