From a9ccc27745def0ef4609f88910ec1e574ac31312 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Fri, 22 May 2015 13:44:26 +0300 Subject: [PATCH] MAGETWO-35512: [GitHub] Product Model sometimes values change in getters methods #1133 --- app/code/Magento/Catalog/Model/Product.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 4b567d53e5dd8..70699ed34557c 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -2266,8 +2266,11 @@ public function getIdentities() } } if ($this->getOrigData('status') != $this->getData('status')) { - foreach ($this->getData('category_ids') as $categoryId) { - $identities[] = self::CACHE_PRODUCT_CATEGORY_TAG . '_' . $categoryId; + $categoryIds = $this->getData('category_ids'); + if (!empty($categoryIds)) { + foreach ($categoryIds as $categoryId) { + $identities[] = self::CACHE_PRODUCT_CATEGORY_TAG . '_' . $categoryId; + } } } return array_unique($identities);