-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
PHP8 compatibility issue with array_merge #39579
Comments
Hi @chazzs. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Hotel. Thank you for working on this issue.
|
Hello @chazzs, Thanks for the report and collaboration! After going through the issue description it seems you are talking about the below interface: magento2/app/code/Magento/UrlRewrite/Model/StorageInterface.php Lines 12 to 14 in 2217274
which further extends magento2/app/code/Magento/UrlRewrite/Model/UrlPersistInterface.php Lines 14 to 21 in 2217274
But we need some more information on this issue as below:
Please provide us with the information. Thanks |
It should be pretty clear in the OP.
the actual result is the error mentioned in the OP. the expected result is mentioned in the OP as well. it should basically be a No-op OR it should throw out an exception that is more meaningful than the "bad PHP" error. OR documentation should be updated to not imply that doing this with a URL rewrite that does not exist will not result in a core PHP error/exception. I do no know enough about PHP to know how the fancy ellipsis as an argument works but, it seems PHP8 has significantly changed this behavior. |
Hello @chazzs, Thanks for the reply! However, we cannot reproduce this issue in the latest 2.4-develop branch. We have tried to make a custom module and call the Please refer to this module: Please let us know if we missed anything. Thanks |
I am under a deadline and I had to devise a workaround first before taking the time to file the bug. I took a look through the edit history of the function i was working with and saw that if you do not provide the Entity ID( so from
to
|
When using \Magento\UrlRewrite\Model\StorageInterface::replace() when the url rewrite does not exist throws out
ArgumentCountError: array_merge() does not accept unknown named parameters in .../vendor/magento/module-url-rewrite/Model/Storage/DbStorage.php:223
Code documentation for replace() reads
Save new url rewrites and remove old if exist.
this indicates that this function should succeed/finish (not throw an exception) if the URLrewrite does not currently exist.is this an error or an error in code documentation? If it is an error in documentation should it not throw out a more meaningful exception rather than a core php error?
The text was updated successfully, but these errors were encountered: