Skip to content
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

Conversation

srsathish92
Copy link
Contributor

@srsathish92 srsathish92 commented Feb 22, 2020

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 from InputException)

Questions or comments

If any please let me know the feedback's

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Feb 22, 2020

Hi @srsathish92. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@sdzhepa sdzhepa linked an issue Feb 25, 2020 that may be closed by this pull request
@magento-engcom-team
Copy link
Contributor

Hi @aleron75, thank you for the review.
ENGCOM-6983 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Before:
before

After:
after

@m2-assistant
Copy link

m2-assistant bot commented Feb 28, 2020

Hi @srsathish92, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined variable $type in Product-Link Management
5 participants