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

Duplicate call to $this->getLinkField(); #9017

Closed
will-b opened this issue Mar 26, 2017 · 5 comments
Closed

Duplicate call to $this->getLinkField(); #9017

will-b opened this issue Mar 26, 2017 · 5 comments
Assignees
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@will-b
Copy link
Contributor

will-b commented Mar 26, 2017

There is a duplicate call to the getLinkField method inside Magento/Catalog/Model/ResourceModel/Category.php
in the getChildren method

$linkField = $this->getLinkField();
$attributeId = $this->getIsActiveAttributeId();
$backendTable = $this->getTable([$this->getEntityTablePrefix(), 'int']);
$connection = $this->getConnection();
$checkSql = $connection->getCheckSql('c.value_id > 0', 'c.value', 'd.value');
$linkField = $this->getLinkField();

Preconditions

  1. Magento version 2.1.3
  2. Or Magento develop branch

Steps to reproduce

  1. Inspect code of Magento/Catalog/Model/ResourceModel/Category.php

Expected result

  1. Expect $this->getLinkField() not to be called more than required

Actual result

  1. $this->getLinkField() is unnecessarily called a second time
@davidalger
Copy link
Member

@will-b Mind opening a PR with the suggested fix? I agree from the code you noted above, there is a duplicate call there.

@will-b
Copy link
Contributor Author

will-b commented Mar 30, 2017

@davidalger created PR

@davidalger
Copy link
Member

@will-b Super, thanks! I'll close this out once the PR is merged into the mainline.

@davidalger davidalger self-assigned this Mar 30, 2017
magento-team pushed a commit that referenced this issue Apr 1, 2017
 - Merge Pull Request #9057 from will-b/magento2:develop
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-66959

@magento-team magento-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development develop labels Jul 31, 2017
@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development develop Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

@will-b, thank you for your report.
The issue is already fixed in 2.2.0

@magento-engcom-team magento-engcom-team added 2.2.x Fixed in 2.2.x The issue has been fixed in 2.2 release line labels Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

4 participants