Skip to content

Commit

Permalink
Ensure store-scoped values selected before default
Browse files Browse the repository at this point in the history
When a category is created under a store scope before the default scope,
fetching the attributes on a page load will load NULL values rendering
those fields blank.
  • Loading branch information
mattdavenport authored and elidrissidev committed Jan 25, 2023
1 parent df0ebab commit 234e6e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/code/core/Mage/Catalog/Model/Resource/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ protected function _getLoadAttributesSelect($object, $table)
$select = $this->_getReadAdapter()->select()
->from(['attr_table' => $table], [])
->where("attr_table.{$this->getEntityIdField()} = ?", $object->getId())
->where('attr_table.store_id IN (?)', $storeIds);
->where('attr_table.store_id IN (?)', $storeIds)
->order('attr_table.store_id ASC');
if ($setId) {
$select->join(
['set_table' => $this->getTable('eav/entity_attribute')],
Expand Down

0 comments on commit 234e6e4

Please sign in to comment.