Skip to content

Commit

Permalink
MAGETWO-58652: [GitHub] REST API multiselect attribute values are sen…
Browse files Browse the repository at this point in the history
…t in an incompatible format and cannot be cleared #6120
  • Loading branch information
Alex Paliarush committed Apr 25, 2017
2 parents f0b8a44 + 87c468b commit 8783ada
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/code/Magento/Webapi/Controller/Soap/Request/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ protected function _prepareResponseData($data, $serviceClassName, $serviceMethod
} elseif (is_array($data)) {
$dataType = substr($dataType, 0, -2);
foreach ($data as $key => $value) {
if ($value instanceof ExtensibleDataInterface || $value instanceof MetadataObjectInterface) {
if ($value instanceof $dataType
// the following two options are supported for backward compatibility
|| $value instanceof ExtensibleDataInterface
|| $value instanceof MetadataObjectInterface
) {
$result[] = $this->_dataObjectConverter
->convertKeysToCamelCase($this->_dataObjectProcessor->buildOutputDataArray($value, $dataType));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public function testCall()
$this->_dataObjectConverter->expects($this->once())
->method('convertStdObjectToArray')
->will($this->returnValue(['field' => 1]));
$this->_methodsMapProcessorMock->method('getMethodReturnType')->willReturn('string');
$operationName = 'soapOperation';
$className = \Magento\Framework\DataObject::class;
$methodName = 'testMethod';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract

public function testGetItems()
{
$this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
$testAttributeCode = 'quantity_and_stock_status';
$expectedOptions = [
[
Expand Down Expand Up @@ -54,7 +53,6 @@ public function testGetItems()
*/
public function testAdd($optionData)
{
$this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
$testAttributeCode = 'select_attribute';
$serviceInfo = [
'rest' => [
Expand Down Expand Up @@ -100,6 +98,7 @@ public function addDataProvider()
AttributeOptionLabelInterface::STORE_ID => 1,
],
],
AttributeOptionInterface::VALUE => ''
];

return [
Expand All @@ -121,7 +120,6 @@ public function addDataProvider()
*/
public function testDelete()
{
$this->_markTestAsRestOnly('Fix inconsistencies in WSDL and Data interfaces');
$attributeCode = 'select_attribute';
//get option Id
$optionList = $this->getAttributeOptions($attributeCode);
Expand Down

0 comments on commit 8783ada

Please sign in to comment.