On 2 jan, 19:34, nate <[EMAIL PROTECTED]> wrote:
> No, it's not a bug.  I returned find('list') to the simple method that
> generateList() was originally.

ok, I understand.

> To get i18n working, you probably have
> to manually set the recursion level, i.e. find('list',
> array('recursive' => 1)).

No, it does not work, and it can be called "a bug" :-) I don't know
exactly where  to report it or how to fix it, so I will explain here :

I have a table of countries, with an id, and the name is in the table
i18n
this way of generating a list works:
$A1=$this->Country->findAll();
$A2=Set::combine($A1,"{n}.Country.id","{n}.Country.name");

this way does not
$B=$this->Country->find('list');

Why ?
I have checked the find function in /cake/libs/model/model.php
it is used for find ('list') and for find ('all').
find ('all') works because it use $this->__filterResults, and so $A1
contains a clean array (see just below) that can be used in
Set::combine with "{n}.Country.name"

Array
(
    [0] => Array
        (
            [Country] => Array
                (
                    [id] => 1
                    [locale] => eng
                    [name] => France
                )

        )
)

In the second case, if you look *in* the find function, the "list"
case returns this:
  return Set::combine($results, $keyPath, $valuePath);

BUT $results is not clean (see below, it's not filtered), while
$valuePath is generated automatically with $this->displayField and
contains "{n}.Country.name"
so the function does not return something

Array
(
    [0] => Array
        (
            [Country] => Array
                (
                    [id] => 1
                )
            [I18n__name] => Array
                (
                    [content] => France
                )

        )
)

I don't know how to fix this nicely, so if someone can work in the
svn, or tell me how to report this elsewhere ... thx :)
Manu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to