Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.3
-
Fix Version/s: None
-
Component/s: Configuration
-
Labels:None
Description
When a global constraint is used via 'share' and it defines a custom validator then the local validator constraint of the object referencing the shared constraint is never called (overriden).
This behavior is not clear and there should be either a warning or the possibility to have a local and a global validator constraint side by side.
config.groovy
grails.gorm.default.constraints = { myConstraint(validator: { String value, object -> }) }
User.groovy
class User {
String username
static constraints = {
username(shared: 'myConstraint', validator: { String value, object ->
// never called
})
}
}
Maybe the global constraints can be more isolated to not affect the local constraints. This may lead to other problems regarding the schema generation.
Activity
Simon Buettner
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Edit [ 10000 ] |
| Affects Version/s | 2.0.3 [ 13094 ] | |
| Component/s | Configuration [ 10415 ] |
Burt Beckwith
made changes -
| Status | Edit [ 10000 ] | Open [ 1 ] |