Skip to content

Commit 1746643

Browse files
author
Alex Paliarush
committed
MAGETWO-58652: [GitHub] REST API multiselect attribute values are sent in an incompatible format and cannot be cleared #6120
1 parent a9e8595 commit 1746643

File tree

1 file changed

+7
-8
lines changed
  • app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator

1 file changed

+7
-8
lines changed

app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/SimpleType.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ class SimpleType
2828
*/
2929
public function getType($attribute)
3030
{
31-
if (in_array($attribute->getAttributeCode(), $this->anyTypeAttributes)) {
31+
$arrayFrontendInputs = ['multiselect'];
32+
$frontendInput = $attribute->getFrontendInput();
33+
if (in_array($attribute->getAttributeCode(), $this->anyTypeAttributes)
34+
|| in_array($frontendInput, $arrayFrontendInputs)
35+
) {
3236
return TypeProcessor::NORMALIZED_ANY_TYPE;
3337
}
34-
$frontendInput = $attribute->getFrontendInput();
38+
3539
$backendType = $attribute->getBackendType();
3640
$backendTypeMap = [
3741
'static' => TypeProcessor::NORMALIZED_ANY_TYPE,
@@ -41,11 +45,6 @@ public function getType($attribute)
4145
'datetime' => TypeProcessor::NORMALIZED_STRING_TYPE,
4246
'decimal' => TypeProcessor::NORMALIZED_DOUBLE_TYPE,
4347
];
44-
$arrayFrontendInputs = ['multiselect'];
45-
$type = $backendTypeMap[$backendType];
46-
if (in_array($frontendInput, $arrayFrontendInputs)) {
47-
$type .= '[]';
48-
}
49-
return $type;
48+
return $backendTypeMap[$backendType];
5049
}
5150
}

0 commit comments

Comments
 (0)