Skip to content

Commit 60972c0

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'falcons/MAGETWO-62560' into MAGETWO-65701
2 parents 3f42a87 + bb0adaa commit 60972c0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/code/Magento/Catalog/Setup/UpgradeData.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,14 @@ private function changePriceAttributeDefaultScope($categorySetup)
372372
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
373373
foreach (['price', 'cost', 'special_price'] as $attributeCode) {
374374
$attribute = $categorySetup->getAttribute($entityTypeId, $attributeCode);
375-
$categorySetup->updateAttribute(
376-
$entityTypeId,
377-
$attribute['attribute_id'],
378-
'is_global',
379-
\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL
380-
);
381-
375+
if (isset($attribute['attribute_id'])) {
376+
$categorySetup->updateAttribute(
377+
$entityTypeId,
378+
$attribute['attribute_id'],
379+
'is_global',
380+
\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL
381+
);
382+
}
382383
}
383384
}
384385
}

0 commit comments

Comments
 (0)