In a form php plugin, $elementId = $elementModel->getId(); does not work anymore

Status
Not open for further replies.

EricWebsite

Member
In a form I use a php plugin, processed at onElementCanView.
In the plugin code, $elementModel->getId() would give me the id of the element currently being processed, and I used it to output the element or not:

$elementId = $elementModel->getId();

if ($elementId == 1224 AND !strpos('{administration___share_raw}',"1")) {
return false;
}

That worked fine in Fabrik 3, but not in Fabrik 4 gamma 3.
Is that a bug, or is there a better way to do this?

Eric
 
Change line 373 in plugins\fabrik_form\php\php.php
to
$php_result = Php::Eval(['code' => $code, 'vars' => ['formModel' => $formModel,'elementModel' => $elementModel]]);
 
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