Magento2: Product resource getAttributeRawValue function does not return anything if there is no default value

Created on 25 Jun 2018  路  16Comments  路  Source: magento/magento2

Preconditions

  1. Magento 2.2.4
  2. PHP 7.1.17

Steps to reproduce

  1. Create a storeview EN
  2. Create a storeview FR
  3. Create a dropdown attribute with some values
  4. Change this attribute value on EN view
  5. Use getAttributeRawValue() to retrieve it, ie
$product->getResource()->getAttributeRawValue($product->getId(), 'attribute_code', $this->_storeManager->getStore()->getId());

Expected result

  1. Value is returned

Actual result

  1. No value is returned because there is no value in default store (store 0).
Catalog mmuk2019 Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

Most helpful comment

@orlangur no it's not. It's not related to the session or translation, the SQL request done by getAttributeRawValue is assuming there is a value for the store 0, but it's not always the case.

All 16 comments

Hi @VincentMarmiesse. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@VincentMarmiesse do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

@magento-engcom-team give me 2.2.4 instance

Hi @VincentMarmiesse. Thank you for your request. I'm working on Magento 2.2.4 instance for you

Hi @VincentMarmiesse, here is your Magento instance.
Admin access: https://i-16382-2-2-4.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

I can't confirm with this instance because I have to write some code and call the function getAttributeRawValue.
Can I do it with your instance?

@VincentMarmiesse is it a duplicate of https://github.com/magento/magento2/issues/15205 maybe? Please check if corresponding PR worked for you.

@orlangur no it's not. It's not related to the session or translation, the SQL request done by getAttributeRawValue is assuming there is a value for the store 0, but it's not always the case.

Hello @VincentMarmiesse, thank you for your report.
We've acknowledged the issue and added to our backlog.

Hi @shikhamis11. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

MM19IN

@magento-engcom-team give me 2.2.4 instance

Hi @funnyboy1190. Thank you for your request. I'm working on Magento 2.2.4 instance for you

Hi @funnyboy1190, here is your Magento instance.
Admin access: https://i-16382-2-2-4.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

mmuk2019

Hi @semajeg. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [x] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [x] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.


Was this page helpful?
0 / 5 - 0 ratings