PHP events sequence

PHP events sequence

borconiborconi 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:

Answers

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin
    Answer ✓

    Before validation. It gives you the option of adding extra validation if you require that.

    Allan

  • borconiborconi Posts: 56Questions: 19Answers: 1

    Is there any event which fires post validation but before the query is executed?
    Thank you

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin
    Answer ✓

    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

  • borconiborconi Posts: 56Questions: 19Answers: 1

    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.

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    That's a clever trick - nice one :smile:

    Allan

This discussion has been closed.