Skip to content

Commit ba90872

Browse files
committed
MAGETWO-52011: Second error message is not displayed when adding product with two invalid file fields to the cart
1 parent 0bdb94e commit ba90872

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/code/Magento/Catalog/Model/Product/Type/AbstractType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ protected function _prepareOptions(\Magento\Framework\DataObject $buyRequest, $p
572572
$options = $product->getOptions();
573573
}
574574
if ($options !== null) {
575-
$result = [];
575+
$results = [];
576576
foreach ($options as $option) {
577577
/* @var $option \Magento\Catalog\Model\Product\Option */
578578
try {
@@ -583,7 +583,7 @@ protected function _prepareOptions(\Magento\Framework\DataObject $buyRequest, $p
583583
->setProcessMode($processMode)
584584
->validateUserValue($buyRequest->getOptions());
585585
} catch (LocalizedException $e) {
586-
$result[] = $e->getMessage();
586+
$results[] = $e->getMessage();
587587
continue;
588588
}
589589

@@ -592,8 +592,8 @@ protected function _prepareOptions(\Magento\Framework\DataObject $buyRequest, $p
592592
$transport->options[$option->getId()] = $preparedValue;
593593
}
594594
}
595-
if (count($result) > 0) {
596-
throw new LocalizedException(__(implode("\n", $result)));
595+
if (count($results) > 0) {
596+
throw new LocalizedException(__(implode("\n", $results)));
597597
}
598598
}
599599

0 commit comments

Comments
 (0)