Skip to content

Commit 9ddcb1f

Browse files
authored
Revert "form builder meta empty meta key which comes from empty level and dup…" (#1673)
This reverts commit 243bdeb.
1 parent ab15c93 commit 9ddcb1f

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

admin/form-builder/assets/js/form-builder.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,7 @@
122122
state.form_fields[i]['read_only'] = false;
123123
}
124124

125-
let meta_exist = state.form_fields.filter( function (field) {
126-
return 'yes' === field.is_meta && field.name === payload.value;
127-
});
128-
129-
if ( meta_exist.length ) {
130-
swal({
131-
text: 'Duplicate Meta Key',
132-
type: 'warning',
133-
confirmButtonColor: '#d54e21',
134-
confirmButtonText: 'Enter another key',
135-
confirmButtonClass: 'btn btn-success',
136-
});
137-
}
138-
139-
if ( ( payload.field_name === 'name' && payload.value.length - 2 < payload.field_name.length ) || ! state.form_fields[i].hasOwnProperty('is_new') ) {
125+
if (payload.field_name === 'name' && ! state.form_fields[i].hasOwnProperty('is_new') ) {
140126
continue;
141127
} else {
142128
state.form_fields[i][payload.field_name] = payload.value;

assets/js/wpuf-form-builder.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,7 @@
122122
state.form_fields[i]['read_only'] = false;
123123
}
124124

125-
let meta_exist = state.form_fields.filter( function (field) {
126-
return 'yes' === field.is_meta && field.name === payload.value;
127-
});
128-
129-
if ( meta_exist.length ) {
130-
swal({
131-
text: 'Duplicate Meta Key',
132-
type: 'warning',
133-
confirmButtonColor: '#d54e21',
134-
confirmButtonText: 'Enter another key',
135-
confirmButtonClass: 'btn btn-success',
136-
});
137-
}
138-
139-
if ( ( payload.field_name === 'name' && payload.value.length - 2 < payload.field_name.length ) || ! state.form_fields[i].hasOwnProperty('is_new') ) {
125+
if (payload.field_name === 'name' && ! state.form_fields[i].hasOwnProperty('is_new') ) {
140126
continue;
141127
} else {
142128
state.form_fields[i][payload.field_name] = payload.value;

0 commit comments

Comments
 (0)