$formModel null in form onBeforeProcess plugins

Status
Not open for further replies.
I am converting a site from Fabrik3 to Fabrik4 and most of it is working well, but I have a problem with several forms’ onBeforeProcess plugins. In them, I use $formModel to make various getElementData and getRowId calls. This works in Fabrik3, but in Fabrik4, $formModel is null. Should it be available, or is there another way of doing this? I suspect it is related to Forum #53712, but do not know what I need to de here.

Fabrik4 Gamma1, Joomla 4.2.8, PHP 8.1.16.
 
$formModel should be there.
Are you using an additional php file?

Can you try
change plugins\fabrik_form\php\php.php line 699 to

$php_result = Php::Eval(['code' => $code, 'vars' => ['formModel' => $formModel, 'data' => $data]]);
 
Last edited:
Thanks very much; that fixes it.

Yes, I am using an additional php file. I like to keep all my code together and just have a single function call in each Fabrik definition.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top