-
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
Adds missing return value in afterSave plugin. #29035
Adds missing return value in afterSave plugin. #29035
Conversation
Hi @hostep. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
@magento run all tests |
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.
Hi @hostep,
Your changes looks good. Could you cover them with unit test?
Hi @ihor-sviziev, please re-read my opening post, sorry I simply don't have the time for tests (if it takes me 5 to 10 times longer to write tests then to write a fix, I'm not going to do it, really sorry). |
@hostep got it, I just missed point related to tests. @engcom-Charlie @engcom-Kilo @engcom-Golf could you help covering this case with unit tests? |
@magento run all tests |
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.
✔ Approved.
Failing tests looks not related to changes form this PR.
Hi @ihor-sviziev, thank you for the review. |
✔️ QA Passed Manual testing scenario:
--- app/etc/config.php 2020-07-08 11:42:38.000000000 +0200
+++ app/etc/config2.php 2020-07-08 11:42:35.000000000 +0200
@@ -30,7 +30,6 @@
'Magento_Payment' => 1,
'Magento_CatalogRuleGraphQl' => 1,
'Magento_CatalogRule' => 1,
- 'Magento_CatalogUrlRewrite' => 1,
'Magento_StoreGraphQl' => 1,
'Magento_Widget' => 1,
'Magento_Quote' => 1,
@@ -39,6 +38,7 @@
'Magento_CmsGraphQl' => 1,
'Magento_EavGraphQl' => 1,
'Magento_CmsUrlRewrite' => 1,
+ 'Magento_CatalogUrlRewrite' => 1,
'Magento_CmsUrlRewriteGraphQl' => 1,
'Magento_User' => 1,
'Magento_Msrp' => 1,
Before: ✖️ Throws the following error: After: ✔️ Store view gets saved without errors and plugin returns a value, in this case Magento\CmsUrlRewrite\Plugin\Cms\Model\Store\View::aftersSave is missing one |
Hi @hostep, thank you for your contribution! |
Description (*)
All after plugins should always return a value, so other plugins which follow them in the stack get the correct input parameters instead of
null
.It appears that in MC-18561 this was forgotten and this can cause crashes when the sort order of default Magento modules are different then in a vanilla installation (which can happen after installing certain custom modules)
See #29034 for more information
The bug was introduced in Magento 2.3.4, so it makes sense if this PR is considered to be backported to 2.3 as well
I have no interest in adding additional automatic tests for this and wouldn't even know how to approach this, so if this is required, somebody else will need to take care of this.
Thanks!
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
See #29034
Questions or comments
Not sure if this is possible, but having a static analyser test to detect after plugins without return values could have prevented this mistake to have entered the code base
Contribution checklist (*)