Skip to content

Commit 2028872

Browse files
authored
Allow item names to start with an underscore (#2958)
Reported in https://community.openhab.org/t/openhab-4-3-item-name-starting-with-underscore/161244 Regression from #2658 Signed-off-by: Jimmy Tanagra <[email protected]>
1 parent 512ecce commit 2028872

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.openhab.ui/web/src/components/item/item-mixin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
* @returns {string} The error message if the name is invalid, or an empty string if the name is valid.
4545
*/
4646
validateItemName (name) {
47-
if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(name)) {
47+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
4848
return 'Required. Must not start with a number. A-Z,a-z,0-9,_ only'
4949
} else if (this.items && this.items.some(item => item.name === name)) {
5050
return 'An Item with this name already exists'

0 commit comments

Comments
 (0)