Closed forfin closed 3 weeks ago
I'm not sure how to replicate this bug. My steps:
<!-- test -->
<!-- test -->
in the Custom Layout Update.With the steps above, the saving and rendering of category attribute works as expected in a multi-store setting.
Please provide your detail steps to show the bug. Including how your custom attributes are added and rendered in backend.
Custom attribute create by this script
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'bestseller_top_section', [
'group' => 'Custom Design',
'label' => 'Best Seller & Top Section',
'input' => 'textarea',
'type' => 'text',
'default' => '',
'required' => 0,
'visible_on_front' => 1,
'filterable' => 0,
'searchable' => 0,
'comparable' => 0,
'user_defined' => 0,
'is_configurable' => 1,
'is_visible' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'note' => '',
]);
$installer->endSetup();
To reproduce issue value_id
of table catalog_category_entity_text
for store 0 must greater than value_id
of target store.
You can go to db and change value_id
directly.
Or in theory after you add new attr, Try to save value on store level first than save value on default store later.
I added your custom attribute, I cannot replicate the bug:
store api best #27
all store best #27
I deleted the custom attribute, repeated the above with same result. Conclusion is that everything works as expected. If I miss something, please elaborate.
Perhaps it's #2964?
Here video how to reproduce: https://streamable.com/lej637
Custom Layout Update
to store value
, It show store value
as expectedCustom Layout Update
to default value
, It show default value
as expectedCustom Layout Update
now showing default value
. It should be store value
default value
cannot be change from this storeHey, I just have a time to look it more closely.
It seems it happen only v19 And it already have a same fix in https://github.com/OpenMage/magento-lts/pull/2966
So I could just add patch manually to my v19 variant.
Description (*)
When I debug why some data I just save didn't show on Catalog -> Manage Categories -> (Choose non-default Store View) -> Custom Design -> (Some custom EAV attrs)
I found that the text actually save on db. But when it query back, it query for both default store (store_id is 0) and target store and later cause issue.
Magento logic seems to rely on order of values query from db, like first match item will be a value for default store while second item will be a value for target store.
catalog_category_entity_text
produce by query of_getLoadAttributesSelect
functiontargetStoreValueIJustSave
Then on Magento admin page, It just show nothing on field I just save.
This PR will make sure if value_id mixed up, Magento still can show a correct value for the store.
Related Pull Requests
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)