jmix
jmix copied to clipboard
Add validation for DynamicAttributes code values (port to 1.x)
Environment
Jmix version: 1.6, 2.x is not affected
Bug Description
DynamicAttribues edit form allows to use symbols that can cause errors, e.g. "."
Steps To Reproduce
- Create project
- Add DynamicAttribues addon
- Create entity, screens for it, run application
- Add dynamic attribute category and dynamic attribute with name containing dot, add it to entity edit screen. Note: you may need to restart app in order to have settings applied.
- Go to entity grid and press add button
Current Behavior
Attribute is created successfully. But Exception is thrown when you try to manage entity connected with it
Caused by: java.lang.IllegalStateException: Could not resolve property path '+Новый.Атрибут' in 'simpledoc$Contract'
at io.jmix.core.MetadataTools.resolveMetaPropertyPath(MetadataTools.java:974) ~[jmix-core-1.5.999-SNAPSHOT.jar:na]
at io.jmix.dynattrui.impl.BaseEmbeddingStrategy.checkPermissions(BaseEmbeddingStrategy.java:121) ~[jmix-dynattr-ui-1.5.999-SNAPSHOT.jar:na]
at io.jmix.dynattrui.impl.BaseEmbeddingStrategy.lambda$findVisibleAttributes$1(BaseEmbeddingStrategy.java:109) ~[jmix-dynattr-ui-1.5.999-SNAPSHOT.jar:na]
Expected Behavior
DyamicAttribute form forbids to save attibutes with dots in name
Note: version 2.x UI already has such validation