Microsoft Visual Studio Professional 2017 (v 15.9.11)
Context
Field names in data template (default inherited from Template) was able to save invalid string with respect of ItemNameValidation regex (i.e. ^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$) in Sitecore.config.
Steps to reproduce
Navigate to sitecore/templates/Sample which was created from Sitecore default installation
Right click the template folder (i.e. Sample) and select New Template...
Give it a name (e.g. NewTemplate) and proceed by clicking OK
Fill the template with 1 section and 3 fields (Single-Line Text)
4.1 Section
MenuItem3
MenuItem3.1
MenuItemName3.1
Save it (Ctrl + S)
Current result
No error was observed in Sitecore Rocks and template was saved successfully. However error message will be prompted when re-save the template without modification in Content Editor (login as admin).
Sitecore Rocks | Template saved
Content Editor | Error on save
Expected result
The behavior should be consistent with Content Editor whereby invalid field name should prevent save action.
Observation
Validation enforced by Content Editor can be found @ Sitecore.Data.Items.ItemUtil.GetItemNameError
Tools
Context
Field names in data template (default inherited from
Template
) was able to save invalid string with respect ofItemNameValidation
regex (i.e.^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$
) inSitecore.config
.Steps to reproduce
sitecore/templates/Sample
which was created from Sitecore default installationCurrent result
No error was observed in Sitecore Rocks and template was saved successfully. However error message will be prompted when re-save the template without modification in Content Editor (login as admin).
Sitecore Rocks | Template saved
Content Editor | Error on save
Expected result
The behavior should be consistent with Content Editor whereby invalid field name should prevent save action.
Observation
Validation enforced by Content Editor can be found @
Sitecore.Data.Items.ItemUtil.GetItemNameError
Code snippet to demonstrate validation:-