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 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2011 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
7
7
namespace Magento \Catalog \Model \Product \Option \Type ;
@@ -70,6 +70,7 @@ public function __construct(
70
70
* @param array $values All product option values, i.e. array (option_id => mixed, option_id => mixed...)
71
71
* @return $this
72
72
* @throws LocalizedException
73
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
73
74
*/
74
75
public function validateUserValue ($ values )
75
76
{
@@ -92,6 +93,8 @@ public function validateUserValue($values)
92
93
if (!$ this ->_isSingleSelection ()) {
93
94
if (is_string ($ value )) {
94
95
$ value = explode (', ' , $ value );
96
+ } elseif (!is_array ($ value )) {
97
+ $ value = [$ value ];
95
98
}
96
99
$ valuesCollection = $ option ->getOptionValuesByOptionId ($ value , $ this ->getProduct ()->getStoreId ());
97
100
$ valueCount = is_array ($ value ) ? count ($ value ) : 0 ;
You can’t perform that action at this time.
0 commit comments