diff --git a/vendor/magento/module-custom-attribute-management/Block/Form/Renderer/Multiselect.php b/vendor/magento/module-custom-attribute-management/Block/Form/Renderer/Multiselect.php index 634b99d3a21..e6804db1345 100644 --- a/vendor/magento/module-custom-attribute-management/Block/Form/Renderer/Multiselect.php +++ b/vendor/magento/module-custom-attribute-management/Block/Form/Renderer/Multiselect.php @@ -49,7 +49,7 @@ class Multiselect extends \Magento\CustomAttributeManagement\Block\Form\Renderer public function getValues() { $value = $this->getValue(); - if (!is_array($value)) { + if ($value && !is_array($value)) { $value = explode(',', $value); } return $value; @@ -63,6 +63,6 @@ class Multiselect extends \Magento\CustomAttributeManagement\Block\Form\Renderer */ public function isValueSelected($value) { - return in_array($value, $this->getValues()); + return ($values = $this->getValues() && is_array($value)) ? in_array($value, $values) : false; } } diff --git a/vendor/magento/module-customer-custom-attributes/view/frontend/templates/form/renderer/multiselect.phtml b/vendor/magento/module-customer-custom-attributes/view/frontend/templates/form/renderer/multiselect.phtml index 9e4264510a2..705803ae8b4 100644 --- a/vendor/magento/module-customer-custom-attributes/view/frontend/templates/form/renderer/multiselect.phtml +++ b/vendor/magento/module-customer-custom-attributes/view/frontend/templates/form/renderer/multiselect.phtml @@ -15,17 +15,22 @@ $fieldCssClass = 'field field-' . $block->getHtmlId(); $fieldCssClass .= $block->isRequired() ? ' required' : ''; ?>
- +
- getHtmlClass()): + ?> class="select getHtmlClass() ?>"> + getOptions() as $option):?> + escapeHtmlAttr($option['value'] !== '')): ?> + + + - getAdditionalDescription()) : ?> -
+ getAdditionalDescription()): ?> +