Skip to content

Commit a1baa6c

Browse files
committed
Merge remote-tracking branch '24094/bugfix-24070' into commpr-10131-1006
2 parents ae4d3b6 + d29d1b0 commit a1baa6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/code/Magento/Backend/view/adminhtml/web/js/validate-store.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,19 @@ define([
4747
_saveHandler: function (form) {
4848
var formData = {},
4949
requestData = {},
50+
counts = {},
5051
options = $.data(form, 'validator').settings;
5152

5253
if ($(form).validation('isValid')) {
5354
$.each($(form).serializeArray(), function () {
55+
counts[this.name] = (counts[this.name] || 0) + 1;
56+
57+
if (formData[this.name]) {
58+
this.name = this.name.replace(new RegExp(/\[\]$/g), '[' + (counts[this.name] - 1) + ']');
59+
}
5460
formData[this.name] = this.value || '';
5561
});
62+
5663
requestData = {
5764
action: $(form).attr('action'),
5865
data: formData

0 commit comments

Comments
 (0)