Skip to content

Commit 33b4b25

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-64838_2' into EPAM-PR-46
2 parents f6e748a + 7df1f16 commit 33b4b25

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,9 @@ protected function convertCustomAttributeValue($customAttributesValueArray, $dat
301301
{
302302
$result = [];
303303
$dataObjectClassName = ltrim($dataObjectClassName, '\\');
304-
$attributesPreprocessorMap = $this->getAttributesPreprocessorsMap();
305304

306305
foreach ($customAttributesValueArray as $key => $customAttribute) {
307-
if($key && is_array($customAttribute) && array_key_exists($key, $attributesPreprocessorMap)) {
308-
$this->runCustomAttributePreprocessors($key, $customAttribute, $attributesPreprocessorMap[$key]);
309-
}
306+
$this->runCustomAttributePreprocessors($key, $customAttribute);
310307
if (!is_array($customAttribute)) {
311308
$customAttribute = [AttributeValue::ATTRIBUTE_CODE => $key, AttributeValue::VALUE => $customAttribute];
312309
}
@@ -370,13 +367,16 @@ private function getAttributesPreprocessorsMap()
370367
*
371368
* @param string $key
372369
* @param mixed $customAttribute
373-
* @return bool
374370
*/
375-
private function runCustomAttributePreprocessors($key, &$customAttribute, $preprocessorlsList)
371+
private function runCustomAttributePreprocessors($key, &$customAttribute)
376372
{
377-
foreach ($preprocessorlsList as $attributePreprocessor) {
378-
if ($attributePreprocessor->shouldBeProcessed($key, $customAttribute)) {
379-
$attributePreprocessor->process($key, $customAttribute);
373+
$preprocessorsMap = $this->getAttributesPreprocessorsMap();
374+
if ($key && is_array($customAttribute) && array_key_exists($key, $preprocessorsMap)) {
375+
$preprocessorsList = $preprocessorsMap[$key];
376+
foreach ($preprocessorsList as $attributePreprocessor) {
377+
if ($attributePreprocessor->shouldBeProcessed($key, $customAttribute)) {
378+
$attributePreprocessor->process($key, $customAttribute);
379+
}
380380
}
381381
}
382382
}

0 commit comments

Comments
 (0)