If you create an entity in a webservice or init block of a page which is not valid, will still be persisted. There is no rollback/check executed that this entity is unvalid

Submitted by chris melman on 15 March 2013 at 11:19

On 26 November 2013 at 15:26 Elmer van Chastelet commented:

Actually, the whole validation seems to be skipped (don’t see log printed which is part of the validation function). Will add a test for this.


On 26 November 2013 at 15:26 Elmer van Chastelet tagged validation

On 26 November 2013 at 15:53 Elmer van Chastelet commented:

Test added.

Next question: What should happen in case validation fails in the init of a page / (ajax)template?
Should the visitor get a 404, a blank page with validation error message, …?


On 28 November 2013 at 12:33 Elmer van Chastelet tagged 1.3.0

On 28 November 2013 at 12:38 Elmer van Chastelet commented:

I’m adding a mechanism that performs validation after rendering a page. Whenever a validation error occurs, the errors are reported in the server log and the page is served with a js popup with the validation errors in it. And most important: the transaction will be rolled back, and invalid entities are not saved.

This might break pages where data-validation should have failed in the first place, but never did because of the lack of checking.

https://svn.strategoxt.org/websvn/WebDSL/webdsls/?op=revision&rev=5856&peg=5856


On 28 November 2013 at 12:38 Elmer van Chastelet tagged important

On 29 November 2013 at 16:15 Elmer van Chastelet closed this issue.

Log in to post comments