Skip to content

Commit 707f1cd

Browse files
committed
#12695: Unable to change attribute type from swatch to dropdown
- fixes after code review.
1 parent 47b2f48 commit 707f1cd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/code/Magento/Swatches/Model/Plugin/EavAttribute.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ protected function setProperOptionsArray(Attribute $attribute)
157157
* Prepare attribute for conversion from any swatch type to dropdown
158158
*
159159
* @param Attribute $attribute
160+
* @throws \Magento\Framework\Exception\LocalizedException
160161
* @return void
161162
*/
162163
protected function convertSwatchToDropdown(Attribute $attribute)
@@ -166,9 +167,7 @@ protected function convertSwatchToDropdown(Attribute $attribute)
166167
if (!empty($additionalData)) {
167168
$additionalData = $this->serializer->unserialize($additionalData);
168169
if (is_array($additionalData) && isset($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY])) {
169-
if ($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY] == Swatch::SWATCH_INPUT_TYPE_VISUAL) {
170-
$this->cleanEavAttributeOptionSwatchValues($attribute->getOption());
171-
}
170+
$this->cleanEavAttributeOptionSwatchValues($attribute->getOption());
172171
unset($additionalData[Swatch::SWATCH_INPUT_TYPE_KEY]);
173172
$attribute->setData('additional_data', $this->serializer->serialize($additionalData));
174173
}

0 commit comments

Comments
 (0)