Skip to content

#16832 - Reworked query in getAttributeRawValue so that it returns a store specific value even if there is no default value #23369

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

Conversation

semajeg
Copy link
Contributor

@semajeg semajeg commented Jun 23, 2019

Description (*)

Reworked query in getAttributeRawValue so that it returns a store specific value even if there is no default value

The query being generated in this function was querying the default value and then joining onto the store value, so if the default value was not present then it would not return a store value, even if there was one.

The query has been changed so that it left joins on both the default value and the store value, so that it does not prevent the return of a store value if there is no default

Fixed Issues (if relevant)

  1. Product resource getAttributeRawValue function does not return anything if there is no default value #16382: Product resource getAttributeRawValue function does not return anything if there is no default value

Manual testing scenarios

  1. Create 2 store views (though 1 will do)
  2. Create a product attribute with no default value, and a store view scope (e.g. a dropdown)
  3. On a product, set a value in one of the child store views, and not at the default level
  4. Call $resourceModel->getAttributeRawValue(, <attribute_code>, );

Questions or comments

Though the tech guidelines say "1.3.1. All new PHP files MUST have strict type mode enabled by starting with declare(strict_types=1);. All updated PHP files SHOULD have strict type mode enabled. PHP interfaces SHOULD NOT have this declaration.". This was discussed at the mm19uk contribution day with Tom Erskine and we decided that this PR should not do that to this file,since it will widen the scope of the PR too much and probably cause a LOT of knock on effects

@m2-assistant
Copy link

m2-assistant bot commented Jun 23, 2019

Hi @semajeg. 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.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jun 23, 2019

CLA assistant check
All committers have signed the CLA.

@semajeg
Copy link
Contributor Author

semajeg commented Aug 1, 2019

Hey @dmanners, got a weird issue here. The "Database Compare Build" is failing now, but when you look at the details, it says it's all passed. Any thoughts?

@semajeg
Copy link
Contributor Author

semajeg commented Aug 9, 2019

Hey @dmanners, got a weird issue here. The "Database Compare Build" is failing now, but when you look at the details, it says it's all passed. Any thoughts?

You can ignore this now @dmanners , all tests are now passing

@semajeg semajeg requested a review from dmanners August 9, 2019 10:38
@ghost ghost assigned josefbehr Aug 23, 2019
@josefbehr josefbehr requested review from dmanners and removed request for dmanners August 23, 2019 10:31
@magento-engcom-team
Copy link
Contributor

Hi @josefbehr, thank you for the review.
ENGCOM-5683 has been created to process this Pull Request
✳️ @josefbehr, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@josefbehr josefbehr added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Aug 23, 2019
@engcom-Delta engcom-Delta self-assigned this Aug 27, 2019
@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Aug 28, 2019

Hi @semajeg, 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.

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.

9 participants