Skip to content

Commit 8783ada

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
2 parents f0b8a44 + 87c468b commit 8783ada

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

app/code/Magento/Webapi/Controller/Soap/Request/Handler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ protected function _prepareResponseData($data, $serviceClassName, $serviceMethod
157157
} elseif (is_array($data)) {
158158
$dataType = substr($dataType, 0, -2);
159159
foreach ($data as $key => $value) {
160-
if ($value instanceof ExtensibleDataInterface || $value instanceof MetadataObjectInterface) {
160+
if ($value instanceof $dataType
161+
// the following two options are supported for backward compatibility
162+
|| $value instanceof ExtensibleDataInterface
163+
|| $value instanceof MetadataObjectInterface
164+
) {
161165
$result[] = $this->_dataObjectConverter
162166
->convertKeysToCamelCase($this->_dataObjectProcessor->buildOutputDataArray($value, $dataType));
163167
} else {

app/code/Magento/Webapi/Test/Unit/Controller/Soap/Request/HandlerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public function testCall()
104104
$this->_dataObjectConverter->expects($this->once())
105105
->method('convertStdObjectToArray')
106106
->will($this->returnValue(['field' => 1]));
107+
$this->_methodsMapProcessorMock->method('getMethodReturnType')->willReturn('string');
107108
$operationName = 'soapOperation';
108109
$className = \Magento\Framework\DataObject::class;
109110
$methodName = 'testMethod';

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract
1717

1818
public function testGetItems()
1919
{
20-
$this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
2120
$testAttributeCode = 'quantity_and_stock_status';
2221
$expectedOptions = [
2322
[
@@ -54,7 +53,6 @@ public function testGetItems()
5453
*/
5554
public function testAdd($optionData)
5655
{
57-
$this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
5856
$testAttributeCode = 'select_attribute';
5957
$serviceInfo = [
6058
'rest' => [
@@ -100,6 +98,7 @@ public function addDataProvider()
10098
AttributeOptionLabelInterface::STORE_ID => 1,
10199
],
102100
],
101+
AttributeOptionInterface::VALUE => ''
103102
];
104103

105104
return [
@@ -121,7 +120,6 @@ public function addDataProvider()
121120
*/
122121
public function testDelete()
123122
{
124-
$this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
125123
$attributeCode = 'select_attribute';
126124
//get option Id
127125
$optionList = $this->getAttributeOptions($attributeCode);

0 commit comments

Comments
 (0)