q2a/question2answer — pull request #61 by pupi1985 (2014-07-27 22:30:56+00:00)
Title: Added firing an event before deleting a post

It seems firing the Q/A/C delete event results in a considerable loss of information by the time the event is caught by event listeners. This happens because the event listener receives the event after the post deletion. This deletion cascades to other tables too, as the ^userpoints table and the parameters passed do not include information from those tables or it is considerably grouped. EG: If at post deletion I would like to know what users upvoted the question I wouldn't be able to do so.

So I thought of adding a before deletion event that would allow plugin developers to fetch whatever information they need from the post just before it is deleted. Alternatively, the deletion events could be fired before the post deletion but I think that wouldn't go along with the other events which are fired after the action is performed... not to mention that if a plugin is already listening to the current delete events that would change their behavior unnecessarily.

This could be added to 1.7 and 1.6.4.