Watch out the order of a form's php plugins

tali

Member
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:
Code:
JFactory::getApplication()->enqueueMessage('on...');
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.
onAfterProcess is not executed.​

Thoughts :
  1. 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
  2. It would be nice also to have an easy way (drap&drop) to change plugins' order
  3. It may help to have the name of the event following "php" when the plugins page is collapsed:
    • php (onBeforeProcess)
    • php (onBeforeStore)
    • php (onAfterProcess)
 
I have never seen this before, and I run a lot of PHP plugins.

Does this only happen if you change the plugin hook selection on some existing plugins?

In other words, if you create 3 from scratch in the "2nd round" order you mentioned, do you still get the same problem?

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top