The order of php plugins should not interfere (this is what I understand from that there is no mention about the order of plugins in the Wiki).
But in fact it does!
Step to reproduce:
In a form, just add plugins each one with only this line:
where on... is the name of the event.
1rst round
Put your plugins in the following order: onBeforeProcess, onBeforeStore, onAfterProcess
Your will correctly get: onBeforeProcess, onBeforeStore, onAfterProcess messages on saving the form.
2nd round
Permute onBeforeProcess and onAfterProcess, which means: change onBeforeProcess to onAfterProcess (and adapt the message) and vice versa so to have your plugins in the following order: onAfterProcess, onBeforeStore, onBeforeProcess.
Your will incorrectly get: onBeforeProcess, onBeforeStore, onBeforProcess messages on saving the form.
Thoughts :
But in fact it does!
Step to reproduce:
In a form, just add plugins each one with only this line:
Code:
JFactory::getApplication()->enqueueMessage('on...');
1rst round
Put your plugins in the following order: onBeforeProcess, onBeforeStore, onAfterProcess
Your will correctly get: onBeforeProcess, onBeforeStore, onAfterProcess messages on saving the form.
2nd round
Permute onBeforeProcess and onAfterProcess, which means: change onBeforeProcess to onAfterProcess (and adapt the message) and vice versa so to have your plugins in the following order: onAfterProcess, onBeforeStore, onBeforeProcess.
Your will incorrectly get: onBeforeProcess, onBeforeStore, onBeforProcess messages on saving the form.
onAfterProcess is not executed.
Thoughts :
- It would be nice at least to have documented on the Form's PHP Plugins page that the plugins have to be in the following order: onBeforeProcess, onBeforeStore, onAfterProcess
- It would be nice also to have an easy way (drap&drop) to change plugins' order
- It may help to have the name of the event following "php" when the plugins page is collapsed:
- php (onBeforeProcess)
- php (onBeforeStore)
- php (onAfterProcess)