• Fabrik V4.4.1 is now available.

    This version corrects the Admin issue introduced by V4.4. V4.4.1 is available through the Joomla Updater or for download through your My Downloads area of our website.

    Turns out a code change intended for our 5.0dev branch inadvertantly got pushed to the 4.x branch (by me, duh!). The javascript structure in 5.0 will change considerably and part of that change took effect with the inadvertant code change.

    We have reverted the code change and released 4.4.1. V4.4 has been retracted.

    Sorry for any inconvenience.

  • A new version of Full Calendar is now available.

    See the details here

CDD > Advanced > Eval Options code using $data or $formModel

Status
Not open for further replies.

pastvne

Bruce Decker
Porting and testing code from 3x to 4x and running into an issue on a CDD eval options PHP code set.

In 3.x I was able to (but probably should not have) done this:

Code:
$divisionCode = $data['csp_document_control___division_code_raw'];

It now seems that when I var_dump($data), it is null in this eval.
I was going to try to switch to $formModel but a var_dump of it also shows it is null.

Do I need to expose the $formModel myself in the eval code? If so, what instructions would cause $formData or $data to become visible? Or, more properly, how would I access a form value in the CDD Advanced > Eval Options PHP?
 
Last edited:
The only var that was previously available was $data. Can you change line 548 of plugins/fabnrik_element/cascadingdropdown/cascadingdropdown.php to the following:

Code:
if (Php::Eval(['code' => $eval, 'vars'=>['opt'=>$opt, 'data'=>$data]]) === false)

And let us know if that fixes it for you.
 
Additionally you should change your code to
$divisionCode = $data['csp_document_control___division_code_raw'] ?? ''; //or whatever default makes sense
to prevent " Debug: Caught exception on eval of CCD 0: Undefined array key" on form load
 
The only var that was previously available was $data. Can you change line 548 of plugins/fabnrik_element/cascadingdropdown/cascadingdropdown.php to the following:

Code:
if (Php::Eval(['code' => $eval, 'vars'=>['opt'=>$opt, 'data'=>$data]]) === false)

And let us know if that fixes it for you.

With that fix, the $data array is now exposed as it was in !F3. Many thanks... now back to testing!
 
Additionally you should change your code to
$divisionCode = $data['csp_document_control___division_code_raw'] ?? ''; //or whatever default makes sense
to prevent " Debug: Caught exception on eval of CCD 0: Undefined array key" on form load

Thank you Troester. I've made that change and will adopt it as best practice. Many thanks as always!
 
Status
Not open for further replies.

Members online

No members online now.
Back
Top