Hi there Stefano,
On the whole I would suggest you upgrade to CakePHP 1.2, currently at
rc2.
If you are coming back to a project you will benefit greatly from
doing the migration to 1.2 now. Most of the people here now develop on
1.2 and it is stable enough and have many many improvements over 1.1.
The IN part is probably not the problem. It looks ok and is basically
shorthand for WHERE Donetask.order_id = 00019281 OR Donetask.order_id
= 00019280...
It is difficult to point at something specific (have not used 1.1 for
almost a year now) but you could check:
• recursive. Check so that it is set to something like 1 or 2
• check the syntax, so it did not change (shouldn't have but...):
findAll($conditions, $fields, $order, $limit, $page, $recursive)
• run the SELECT statement manually on the database to see what
happens. Error? Results? Empty?
• Check your version of MySQL. Is it old or new? You might try to
change the mysql handler in config/database.php to see if there is
some incompatibility.
Sorry, those were all longshots. Good luck, hope you figure it out.
regards
Martin
On Jul 7, 6:23 pm, stefano <[EMAIL PROTECTED]> wrote:
> After some months where working for another company brought me away
> from cake :-( now I have to do some developement on a Cake application
> I wrote months ago.
>
> First of all I updated from 1.1.15.5144 to 1.1.19.6305
>
> But now I have an unexpected result with a findAll() on a query. Maybe
> in the past month something changhed in Cake and I have miss it, so
> I'm asking your help.
>
> I have a model Order wich $hasMany = 'Donetask' and $belongsTo =
> 'Client,User'
> When a run a findAll() query on Order it returns all the Orders, each
> one with the associates Client and User, but none of the many
> associates Donetasks.
>
> Printing the resultset with debug() reports the right associated
> models but looks like the Donetasks array is empty:
>
> Array
> (
> [0] => Array
> (
> [Order] => Array
> (
> [id] => 00019281
> [titolo] => PANTALONE
> [stagione] => S
> [client_id] => 23
> [user_id] => 1
> [created] => 2008-07-03
> [modified] => 2008-07-04 17:25:27
> )
>
> [Client] => Array
> (
> [id] => 00023
> [nomeazienda] => Manifatture del Nord srl
> unipersonale
> [codcliente] => 1052
> [codcad] =>
> [created] => 2005-11-16 10:18:50
> [modified] => 2006-02-27 05:11:51
> [deleted] =>
> )
>
> [Donetask] => Array
> (
> )
>
> )
>
> When I set the debug level to 2 the resulting Donetask query looks as
> follow, maybe is the IN() parts that creats problems?
>
> SELECT `Donetask`.`id`, `Donetask`.`order_id`,
> `Donetask`.`donework_id`, `Donetask`.`task_id`, `Donetask`.`user_id`,
> `Donetask`.`tempo`, `Donetask`.`pezzi`, `Donetask`.`metri`,
> `Donetask`.`note`, `Donetask`.`created`, `Donetask`.`modified`,
> `Donetask`.`costo_tecnico_cr`, `Donetask`.`prezzo_tecnico_cr`,
> `Donetask`.`prezzo_praticato_cr`, `Donetask`.`note_v`,
> `Donetask`.`facon`, `Donetask`.`mag_facon`, `Donetask`.`prezzo_il`
> FROM `donetasks` AS `Donetask` WHERE `Donetask`.`order_id` IN
> ('00019281', '00019280', '00019279', '00019278', '00019277',
> '00019276', '00019275', '00019274', '00019273', '00019272',
> '00019271', '00019269', '00019268', '00019267', '00019266',
> '00019265', '00019264', '00019263', '00019262', '00019261')
>
> Note that just before the upgrate the results where ok
>
> Thank you for any hints ;-)
>
> Stefano
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---