Skip to content

Commit 9d70a32

Browse files
committed
Fix #26427 - Expand all sections that contains invalid elements
1 parent c842d73 commit 9d70a32

File tree

1 file changed

+14
-8
lines changed
  • app/code/Magento/Config/view/adminhtml/templates/system/config

1 file changed

+14
-8
lines changed

app/code/Magento/Config/view/adminhtml/templates/system/config/edit.phtml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,21 @@ require([
256256
});
257257

258258
window.configForm.on('invalid-form.validate', function (event, validation) {
259-
var firstActive = jQuery(validation.errorList[0].element || []);
260-
261-
if (firstActive.length) {
262-
jQuery(firstActive.parents('.section-config')).each(function () {
263-
if (!jQuery(this).hasClass('active')) {
264-
Fieldset.toggleCollapse(jQuery(this).children('.config.admin__collapsible-block').attr('id'));
265-
}
266-
})
259+
if (validation.errorList.length === 0) {
260+
return;
267261
}
262+
263+
jQuery.each(validation.errorList, function () {
264+
var element = jQuery(this.element || []);
265+
266+
if (element.length) {
267+
jQuery(element.parents('.section-config')).each(function () {
268+
if (!jQuery(this).hasClass('active')) {
269+
Fieldset.toggleCollapse(jQuery(this).children('.config.admin__collapsible-block').attr('id'));
270+
}
271+
});
272+
}
273+
});
268274
})
269275

270276
$$('.shared').each(function(element){

0 commit comments

Comments
 (0)