Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically scaffolded Edit-View gives incorrect feedback for illegal Updates #24

Open
markoschnecke opened this issue May 18, 2016 · 2 comments

Comments

@markoschnecke
Copy link

Steps to Reproduce

  1. create an exampleDomain with a string that is unique
  2. create a controller for that domain with static scaffold = exampleDomain
  3. start the application
  4. create two objects ("1" & "2")
  5. edit the string in object "1" to "2"

Expected Behaviour

The application should give an error message that the string is unique and thus can't be renamed

Actual Behaviour

The application responds that the update was successful while the update did not actually take place

Environment Information

  • Operating System: Ubuntu
  • Grails Version: 3.1.6
  • JDK Version: 1.7

Example Application

See attachment

@markoschnecke markoschnecke changed the title Dynamically scaffolded Edit-View gives incorrect feedback for an illegal Dynamically scaffolded Edit-View gives incorrect feedback for an illegal Update May 26, 2016
@markoschnecke markoschnecke changed the title Dynamically scaffolded Edit-View gives incorrect feedback for an illegal Update Dynamically scaffolded Edit-View gives incorrect feedback for illegal Updates May 26, 2016
@fbartnitzek
Copy link

the bug still exists in current / the latest grails versions:

  • grails v3.2.8 with plugin v3.3.2
  • grails v3.3.1 with plugin v3.4.0

see example app: https://github.com/fbartnitzek/grails3-no-scaffold-validation-msg

IMHO its a huge grails-bug if the standard validation of a domain class does not work properly and should not be ignored for more than a year (plugin or not).

@mrankin32
Copy link

I'm having the same issue a year later with grails v3.2.11 with plugin v3.4.1

Looking at the code from here it looks like an easy fix.

try { ${propertyName}Service.save(${propertyName}) } catch (ValidationException e) { respond ${propertyName}.errors, view:'create' return }

The above code does not catch the ValidationException because save(failOnError:true) isn't set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants