• Fabrik4.5.1 for Joomla5.2.4

    Fabrik4.5.1 is out. This update is needed for J!5.2.4

    See Announcements

PHP validation Condition does not work on element's value

Status
Not open for further replies.

EricWebsite

Member
On Joomla 4.3.1, PHP 8.1.18, Cassiopeia template, Upgraded from J3,F3 > J4,F4, Fabrik 4 gamma3

Using the $data to set a simple Condition to only run the validation when there is text in the $data field, like:

return $data > '';

or

if (strlen($data) > 0) {
return true;
} else {
return false;
}

always returns false and the validation is not run. In Fabrik 3 this works.
 
Change components\com_fabrik\models\validation_rule.php line 155 to

$res = Php::Eval(['code' => $condition, 'vars'=>['formModel'=>$formModel, 'data'=>$data]]);
 
Status
Not open for further replies.

Members online

No members online now.
Back
Top