[BUG] with Cascading dropdown placeholders does not work with eval

karpa

New Member
i have two ellements..
"usernames" and "countries". usernames is a field with autocomplete, where countries is a dropdown that depends from usernames.

I need to make a function like, "get as dropdown options all countries where their first letter, is the same as the username firstletter" e.g "george" brings options "Georgia, Greece, Germany" etc.

So in the "advanced->eval options" i added my php code. The problem is that i tried to use placeholder e.g $username = '{mytable__username||0}';
But it is not working..

Any suggetions??
Thanks

PS similar problem.. http://fabrikar.com/forums/index.ph...l-options-do-not-evaluate-placeholders.38369/
But solution not working for me..
 
I managed to solve my problem if anyone is having the same problem, with a workaround.

In the end i didn't use any placeholders!

In the "eval" textbox i added

$app = JFactory::getApplication();
$userid = $app->input->get('v'); //v holds the selected id. NO PLACEHOLDER here.

$firstletter= getUserfirstletter($userid);
$countryfirstletter = getCountryFirstletter(opt->value);

if ($countryfirstletter == $firstletter) return true;
else return false;


But i discovered a second BUG(?).

The ajax request always returns the same options as the options on load.
To solve this problem i had to edit file "plugins/fabrik_element/cascadingdropdown/cascadingdropdown.php"
line 544
i had to comment out this

if (array_key_exists($sqlKey, $this->optionVals))
{
//return $this->optionVals[$sqlKey]; //DONT RETURN. option values must eval also on ajax requests.
}

Thanks
 
Back
Top