Hi all,
This one is information for the Fabrik team (Rob, Hugh or whoever)...
Either most-all of the documentation for the php form plug-in is wrong (or that plugin has a bug)....
All of the documentation says to use things like:
.. for all areas including onLoad and the events up to that point. However none of that will work up to and including the onLoad event. The only thing (through hours of debugging I found) that will work are things like:
Please note that most or all of the documentation related to element references prior to for events prior to and including onLoad events is incorrect (or the code is). This is potentially very frustrating to (especially new) users. The former above do work as expected for and other events such as onBeforeProcess and the rest of the downstream events in the php plugin. The other form plugins besides php also seem to use the first example just fine in the onLoad and upstream events as well - at least the others I have used to date.
No biggie for me now that I figured this out, and as I said - your call on if you feel this is a "bug" or not, but if not docs should probably be updated soon.
Thanks,
Dale
This one is information for the Fabrik team (Rob, Hugh or whoever)...
Either most-all of the documentation for the php form plug-in is wrong (or that plugin has a bug)....
All of the documentation says to use things like:
PHP:
$name = $formModel->formData['tablename___name'];
if ($name === 'rob')
{
$formModel->updateFormData('tablename___sport', 'badminton', true);
}
.. for all areas including onLoad and the events up to that point. However none of that will work up to and including the onLoad event. The only thing (through hours of debugging I found) that will work are things like:
PHP:
$name = $formModel->data['tablename___name'];
if ($name === 'rob')
{
$formModel->data['tablename___sport'] = 'badminton';
}
Please note that most or all of the documentation related to element references prior to for events prior to and including onLoad events is incorrect (or the code is). This is potentially very frustrating to (especially new) users. The former above do work as expected for and other events such as onBeforeProcess and the rest of the downstream events in the php plugin. The other form plugins besides php also seem to use the first example just fine in the onLoad and upstream events as well - at least the others I have used to date.
No biggie for me now that I figured this out, and as I said - your call on if you feel this is a "bug" or not, but if not docs should probably be updated soon.
Thanks,
Dale