magento2: Product resource getAttributeRawValue function does not return anything if there is no default value
Preconditions
- Magento 2.2.4
- PHP 7.1.17
Steps to reproduce
- Create a storeview EN
- Create a storeview FR
- Create a dropdown attribute with some values
- Change this attribute value on EN view
- Use
getAttributeRawValue()
to retrieve it, ie
$product->getResource()->getAttributeRawValue($product->getId(), 'attribute_code', $this->_storeManager->getStore()->getId());
Expected result
- Value is returned
Actual result
- No value is returned because there is no value in default store (store 0).
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (13 by maintainers)
@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.