Skip to content

Commit 1d144bc

Browse files
committed
Merge remote-tracking branch 'origin/spartans_pr_17122024' into spartans_pr_11122024
2 parents ac7ec44 + ed04375 commit 1d144bc

File tree

1 file changed

+5
-2
lines changed
  • app/code/Magento/Catalog/Model/Product/Option/Type

1 file changed

+5
-2
lines changed

app/code/Magento/Catalog/Model/Product/Option/Type/Select.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Catalog\Model\Product\Option\Type;
@@ -70,6 +70,7 @@ public function __construct(
7070
* @param array $values All product option values, i.e. array (option_id => mixed, option_id => mixed...)
7171
* @return $this
7272
* @throws LocalizedException
73+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
7374
*/
7475
public function validateUserValue($values)
7576
{
@@ -92,6 +93,8 @@ public function validateUserValue($values)
9293
if (!$this->_isSingleSelection()) {
9394
if (is_string($value)) {
9495
$value = explode(',', $value);
96+
} elseif (!is_array($value)) {
97+
$value = [$value];
9598
}
9699
$valuesCollection = $option->getOptionValuesByOptionId($value, $this->getProduct()->getStoreId());
97100
$valueCount = is_array($value) ? count($value) : 0;

0 commit comments

Comments
 (0)