-
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
#26800 Fixed Undefined variable in ProductLink/Management #26979
#26800 Fixed Undefined variable in ProductLink/Management #26979
Conversation
Hi @srsathish92. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @aleron75, thank you for the review. |
Hi @srsathish92, thank you for your contribution! |
Description (*)
This PR fixed the issue #26800.
Set product links through API with with empty array of items its throws 'undefined variable' if the product has existing links, So I added the additional condition to check array is empty If yes throws the
InputException
.Covered the unit test case with that scenario.
Updated doc blocks in
ProductLinkManagementInterface.php
with exception class.Fixed Issues (if relevant)
#26800
Manual testing scenarios (*)
Unit Test:
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/Catalog/Test/Unit/Model/ProductLink/ManagementTest.php
From API:
URL:
/rest/V1/products/1234/links
Method: POST
Data:
{ "items": [] }
(eariler its throws
undefined variable
if the product has atleast one product link & now its should show valid error message fromInputException
)Questions or comments
If any please let me know the feedback's
Contribution checklist (*)