Skip to content

Commit a837a72

Browse files
author
Oleksandr Gorkun
committed
MC-18685: Remove custom layout updates from admin
1 parent f5c1a4e commit a837a72

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/SalesSampleData/Model/Order/Converter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ protected function getProductAttributes($configurableAttributes)
197197
}
198198
$options = $this->productConverter->getAttributeOptions($attribute->getAttributeCode());
199199
$attributeOption = $options->getItemByColumnValue('value', $value);
200+
if (!$attributeOption) {
201+
throw new \RuntimeException('Required option "' .$value .'" for ' .$attributeCode .' does not exist');
202+
}
200203
$attributeId = $attributeOption->getDataByKey('attribute_id');
201204
$attributesData[$attributeId] = $attributeOption->getDataByKey('option_id');
202205
}

app/code/Magento/SwatchesSampleData/Model/Swatches.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function getOptionSwatchVisual(array $attributeData)
128128
foreach ($attributeData['option'] as $optionKey => $optionValue) {
129129
if (substr($optionValue, 0, 1) == '#' && strlen($optionValue) == 7) {
130130
$optionSwatch['value'][$optionKey] = $optionValue;
131-
} else if ($this->colorMap[$optionValue]) {
131+
} else if (!empty($this->colorMap[$optionValue])) {
132132
$optionSwatch['value'][$optionKey] = $this->colorMap[$optionValue];
133133
} else {
134134
$optionSwatch['value'][$optionKey] = $this->colorMap['White'];

0 commit comments

Comments
 (0)