We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89cf888 commit daeaa21Copy full SHA for daeaa21
app/code/Magento/Backend/view/adminhtml/web/js/validate-store.js
@@ -50,9 +50,17 @@ define([
50
options = $.data(form, 'validator').settings;
51
52
if ($(form).validation('isValid')) {
53
+ const counts = {};
54
$.each($(form).serializeArray(), function () {
- formData[this.name] = this.value || '';
55
+ let name = this.name;
56
+ counts[name] = (counts[name] || 0) + 1;
57
+ if (formData[name]) {
58
+ const replacement = '[' + (counts[name] - 1) + ']';
59
+ name = name.replace(new RegExp(/\[\]$/g), replacement);
60
+ }
61
+ formData[name] = this.value || '';
62
});
63
+
64
requestData = {
65
action: $(form).attr('action'),
66
data: formData
0 commit comments