当我在商店视图的各个选项中更改某些内容时,Magento 1.6安装正在删除一篇文章。
确切程序:
- 打开文章
- 切换到商店视图
- 切换到单个选项
- 取消选中选项上的"使用默认值"
保存后,文章已不存在。
更确切地说:它删除id为273
(状态)的属性。当我手动执行此SQL时,文章已备份:
INSERT INTO catalog_product_entity_int SET entity_type_id=10, attribute_id=273, store_id=0, entity_id=507, value=1;
(其中entity_id是丢失物品的id)。
当我恢复文章时,它在再次保存后就不见了,即使我重新检查了默认选项。
有什么想法吗?
我并没有真正明白,但是:
if ($result &&
($attribute->isScopeStore() || $attribute->isScopeWebsite()) &&
!$this->_isAttributeValueEmpty($attribute, $value) &&
$value == $origData[$attribute->getAttributeCode()] &&
isset($origData['store_id']) && $origData['store_id'] != $this->getDefaultStoreId()
) {
return false;
}
/* +++ THIS IS NEW +++ */
if ($value === FALSE) {
return FALSE;
}
/* ^^^ THIS IS NEW ^^^ */
修复了它。不知怎么的,原来的if应该归还它,但它没有。