Entity creation in init/webservices are not rolledback on validation errors.
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 unvalidSubmitted by chris melman on 15 March 2013 at 11:19
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.
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, …?
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.
Log in to post comments