Skip to content

Commit 5b7a719

Browse files
MAGETWO-82991: Product attribute creation page handles Storefront tab visibility wrong #11770
2 parents 00929c8 + b5b120c commit 5b7a719

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ function switchDefaultValueField()
196196

197197
<?php foreach ($this->helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields() as $type => $fields): ?>
198198
case '<?= /* @escapeNotVerified */ $type ?>':
199+
var isFrontTabHidden = false;
199200
<?php foreach ($fields as $one): ?>
200201
<?php if ($one == '_front_fieldset'): ?>
201202
getFrontTab().hide();
203+
isFrontTabHidden = true;
202204
<?php elseif ($one == '_default_value'): ?>
203205
defaultValueTextVisibility =
204206
defaultValueTextareaVisibility =
@@ -210,6 +212,10 @@ function switchDefaultValueField()
210212
setRowVisibility('<?= /* @escapeNotVerified */ $one ?>', false);
211213
<?php endif; ?>
212214
<?php endforeach; ?>
215+
216+
if (!isFrontTabHidden){
217+
getFrontTab().show();
218+
}
213219
break;
214220
<?php endforeach; ?>
215221

app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ define([
182182
useProductImageForSwatch = false,
183183
defaultValueUpdateImage = false,
184184
optionDefaultInputType = '',
185+
isFrontTabHidden = false,
185186
thing = this;
186187

187188
if (!this.frontendInput.length) {
@@ -246,6 +247,7 @@ define([
246247
switch (option) {
247248
case '_front_fieldset':
248249
thing.tabsFront.hide();
250+
isFrontTabHidden = true;
249251
break;
250252

251253
case '_default_value':
@@ -262,6 +264,11 @@ define([
262264
thing.setRowVisibility($('#' + option), false);
263265
}
264266
});
267+
268+
if (!isFrontTabHidden) {
269+
thing.tabsFront.show();
270+
}
271+
265272
} else {
266273
this.tabsFront.show();
267274
this.showDefaultRows();

0 commit comments

Comments
 (0)