Skip to content

[Forwardport] Fix adding values to system variable collection #13735

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

Merged
merged 2 commits into from
Feb 21, 2018
Merged

[Forwardport] Fix adding values to system variable collection #13735

merged 2 commits into from
Feb 21, 2018

Conversation

nmalevanec
Copy link
Contributor

Original Pull Request

#13596
Changed select fields in joined variable value table in Magento\Variable\Model\ResourceModel\Variable\Collection#addValuesToResult() method to match DB schema

Description

Method mentioned above tried to select field value from joined variable_value table (which doesn't exist). I've replaced incorrect field with two proper ones: plain_value and html_value.

Fixed Issues

Calling Magento\Variable\Model\ResourceModel\Variable\Collection#addValuesToResult() method results with Zend_Db_Statement_Exception thrown. Exception message:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'value_table.value' in 'field list', query was: SELECT `main_table`.*, `value_table`.`value` FROM `variable` AS `main_table`  
   INNER JOIN `variable_value` AS `value_table` ON value_table.variable_id = main_table.variable_id WHERE (`value_table`.`store_id` = 0)

Manual testing scenarios

As the method is not used anywhere in the magento core there is no way to reproduce error with just clicking.

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 on Travis CI are green)

mszydlo and others added 2 commits February 19, 2018 15:03
Changed select fields in joined variable value table in Magento\Variable\Model\ResourceModel\Variable\Collection#addValuesToResult() method to match DB schema
@ihor-sviziev
Copy link
Contributor

Hi @nmalevanec your changes looks good for me. Also I see that you covered these changes with unit test (that was missing in 2.2-develop branch). Could you create separate PR to 2.2-develop branch with adding test?

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
MAGETWO-88039 has been created to process this Pull Request

@nmalevanec
Copy link
Contributor Author

@ihor-sviziev , done: #13742

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.

4 participants