Skip to content

Commit 897cd06

Browse files
Update regex, and add new translation with regex params. (#1024)
Co-authored-by: lukemacausland <[email protected]>
1 parent 195f6e3 commit 897cd06

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

public/js/pimcore/object/objectbrick.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,12 @@ pimcore.object.objectbrick = Class.create(pimcore.object.fieldcollection, {
182182
},
183183

184184
addField: function () {
185-
Ext.MessageBox.prompt(' ', t('enter_the_name_of_the_new_item'),
185+
Ext.MessageBox.prompt(' ', t('enter_the_name_of_the_new_object_brick'),
186186
this.addFieldComplete.bind(this), null, null, "");
187187
},
188188

189189
addFieldComplete: function (button, value, object) {
190-
191-
var isValidName = /^[a-zA-Z][a-zA-Z0-9]*$/;
190+
const isValidName = /^[a-zA-Z]\w*$/;
192191

193192
if (button == "ok" && value.length > 2 && isValidName.test(value) && !in_arrayi(value, this.forbiddenNames)) {
194193
Ext.Ajax.request({

translations/admin.en.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,4 +1027,5 @@ zip_upload_want_to_overwrite_no_option: 'No'
10271027
invalid_option: 'Invalid Option field [ {field} ]: Please choose a valid option for select / multiselect field [ {field} ]. Current value: "{option}"'
10281028
respect_timezone: 'Respect timezone'
10291029
delete_quantity_value_unit_confirmation: 'Deleting this unit will impact all related elements that reference it. Are you sure you want to proceed?'
1030-
no_preview_available: 'Sorry, no preview available'
1030+
no_preview_available: 'Sorry, no preview available'
1031+
enter_the_name_of_the_new_object_brick: 'Enter the name of the new brick (a-z, A-Z, 0-9, must start with letter)'

0 commit comments

Comments
 (0)