PHP events sequence
PHP events sequence
borconi
Posts: 56Questions: 19Answers: 1
Is the PHP preEdit
event supposed to fire before data validation or after, and is it supposed to fire even if validation failed?
My understanding was/is that the event should only fire prior to data being updated in the database and that will imply that the data is valid. Have I misunderstand something? Currently I'm experiencing preEdit event being fired even if the validation have failed.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Before validation. It gives you the option of adding extra validation if you require that.
Allan
Is there any event which fires post validation but before the query is executed?
Thank you
No not yet. But that is a feature that has been requested for 1.6 and I'm likely to put it in. 1.6 however, probably won't be available for a few months yet.
Allan
Thank Allan.
No problems, I have managed to work around it. I have set all the fields to false meaning nothing is actually updated/created by editor, and I have moved the queries to
postEdit
wich only gets fired after the query have been executed, but since all the fields are set to false nothing is actually executed so I can run all the queries myself manually.That's a clever trick - nice one
Allan