Skip to content

Commit 7115fe4

Browse files
committed
ACP2E-3523: Issue with Default Attribute Option Value Behavior for Multiselect
1 parent 99b9e24 commit 7115fe4

File tree

2 files changed

+3
-2
lines changed
  • app/code/Magento/Catalog
    • Controller/Adminhtml/Product/Attribute
    • view/adminhtml/templates/catalog/product/attribute

2 files changed

+3
-2
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function execute()
271271
if (array_key_exists('reset_is-default_option', $data) && $data['reset_is-default_option']) {
272272
unset($data['reset_is-default_option']);
273273
$data['default_value'] = null;
274-
} else {
274+
} elseif(isset($data['default'])) {
275275
$data['default_value'] = implode(",", $data['default']);
276276
}
277277

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use Magento\Catalog\Helper\Data;
77

88
/** @var \Magento\Backend\Block\Template $block */
99
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
10+
/** @var $escaper \Magento\Framework\Escaper */
1011
?>
1112

1213
<?php
@@ -234,7 +235,7 @@ script;
234235
elseif ($one == '_scope'):
235236
$scriptString .= 'scopeVisibility = false;';
236237
else:
237-
$scriptString .= "setRowVisibility('" . $block->escapeJs($one) . "', false);";
238+
$scriptString .= "setRowVisibility('" . $escaper->escapeJs($one) . "', false);";
238239
endif;
239240
endforeach;
240241
$scriptString .= <<<script

0 commit comments

Comments
 (0)