Stack dump in AJAX return from calc

jcc

Member
Fabrik 3.10, j!3.10.12 converted to Fabrik 4.0 official release, J!4.4.2
Applied Fabrik update fabrikar-publicfabrik-74a67035f558 (2024-04-12) git kit
SEF & URL rewrite on


On a calc field, I am getting exception within the AJAX response (before the JSON document):

Warning: Array to string conversion in plugins\fabrik_element\dropdown\dropdown.php on line 449
o
o
o
15 0.2819 3584200 PlgFabrik_ElementCalc->onAjax_calc( ) ...\CMSPlugin.php:289
16 0.5191 5625368 PlgFabrik_Element->swapValuesForLabels( $d = ['tblorder___orderid' ... => [0 => '01-08 A02'], ...] ) ...\calc.php:483
17 0.6636 6426824 PlgFabrik_ElementDropdown->getLabelForValue( $v = [0 => '5'], $defaultLabel = [0 => '5'], $forceCheck = TRUE ) ...\element.php:8238

I see that getLabelForValue tries to convert $v to a string and $v seems to be passed in as an array. Any ideas?
 
This is a warning which will vanish if you reduce your J! error reporting level.
But I think it should not be an array.
String conversion was added because of a type comparison which was failing on integer values.

What is your calc code?
 
You are, of course, correct. Setting Error reporting to None does remove the the dump, and so this is no longer a problem. Thanks!

FWIW - The code gets values for a few elements and calls a function. Only the first one in the example is a dropdown element; the other two are databasejoins.

Code:
require_once JPATH_ROOT . '/components/com_fabrik/orders.php';
$pickuplocationid   = (int)'{tblorder___pickuplocationid_raw}';
$dropofflocationid  = (int)'{tblorder___dropofflocationid_raw}';
$jobid              = ((int)'{tblorder___jobid_raw}');
return Orders::getDetail($pickuplocationid,$dropofflocationid,$jobid);

It looks like my code is returning the expected results.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top