File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/code/Magento/Catalog/Model/Product/Option/Type Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 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
77namespace 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 ;
You can’t perform that action at this time.
0 commit comments