We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 927a6e2 commit bbf0aedCopy full SHA for bbf0aed
app/code/Magento/Swatches/Model/Plugin/EavAttribute.php
@@ -130,9 +130,17 @@ protected function setProperOptionsArray(Attribute $attribute)
130
$swatchesArray = $attribute->getData('swatchtext');
131
}
132
if ($canReplace == true) {
133
- $attribute->setData('option', $optionsArray);
134
- $attribute->setData('default', $defaultValue);
135
- $attribute->setData('swatch', $swatchesArray);
+ if (!empty($optionsArray)) {
+ $attribute->setData('option', $optionsArray);
+ }
136
+ if (!empty($defaultValue)) {
137
+ $attribute->setData('default', $defaultValue);
138
+ } else {
139
+ $attribute->setData('default', [0 => $attribute->getDefaultValue()]);
140
141
+ if (!empty($swatchesArray)) {
142
+ $attribute->setData('swatch', $swatchesArray);
143
144
145
146
0 commit comments