Grails

Domain validation errors should not replace any previously existing errors

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Currently, when you run a domain's validate() or save() method, any previously existing errors in the domain's errors object is replaced. For instance:

domain class TestDomain

def test = new TestDomain(params)
test.errors.reject('custom.error.code')
if (!test.save()) {
println test.errors
}

The println will only show validation errors caused by the save() method. The previously added error message is now gone. This SHOULD NOT be the intended behavior.

Activity

Hide
Graeme Rocher added a comment -

Moving non-critical issues that aren't going to make it into 1.1 to 1.2

Show
Graeme Rocher added a comment - Moving non-critical issues that aren't going to make it into 1.1 to 1.2
Hide
Graeme Rocher added a comment -

There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3

for 1.2 final only issues considered blocking will now be fixed

Show
Graeme Rocher added a comment - There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3 for 1.2 final only issues considered blocking will now be fixed
Hide
Clemens Schneider added a comment -

Same happens for regular POGOs annotated with @Validateable.
In case you want to do nested validation and use the Errors instance #pushNestedPath() method and call #validate() afterwards, the errors instance is replaced and the changes did not have any effect.

Show
Clemens Schneider added a comment - Same happens for regular POGOs annotated with @Validateable. In case you want to do nested validation and use the Errors instance #pushNestedPath() method and call #validate() afterwards, the errors instance is replaced and the changes did not have any effect.

People

Vote (4)
Watch (4)

Dates

  • Created:
    Updated:
    Last Reviewed: