Check the Data that comes back from the 
db<https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Behavior/TreeBehavior.php#L386>.
 
Either it's missing completely (probably due to the recursive setting used 
in the find, since translation data is joined in) or the data is in a 
different position when translated and you'll need to specify the value 
path explicitly.

AD

On Sunday, 1 December 2013 09:16:11 UTC+1, Lucky1968 wrote:
>
> When trying to get language dependent values through javascript from a 
> translated tree model I only get the tree spacers without the actual values.
>
> In my controller I have: 
>
>           $modelObj = new $model_name();
>           if($modelObj->actsAs[0] == 'Tree') { 
>                $optionslist = $modelObj->generateTreeList(null, null, 
> null, TREE_SPACER_ADMIN_LISTING); 
>           } else { 
>                $optionslist = $modelObj->find('list'); 
>           } 
>           $options = ''; 
>           foreach($optionslist as $key => $value) { 
>                $options .= '<option value="' . $key . '">' . $value . 
> '</option>'; 
>           } 
>           echo $options; 
>
> This worked fine in my 1 language site but after changing to i18n the 
> $value only holds the TREE_SPACER_ADMIN_LISTING without the 
> actual $displayField value. 
> When used in combination with a NON-TREE-object it gives me a 
> $displayfield value but not in the selected language 
>
> Can anyone tell me what to add to my code?  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to