I am posting this here because for some reason the Cakephp site won't
let me submit a comment (even though I am logged in;  it says there is
a problem but shows no more info.) So without further ado here is the
situation maybe someone can assist me with.  I am currently playing
around with the Aggregator Behavior posted at Cakephp  and found a bug
but  (the first part) but more importantly I am getting a problem with
Unknown index with the behavior.


**** Bug *****
In the  aggregator example you leave off your "conditions" statement
in the array but the behavior assumes that it exists in the
_updateAllResults function giving an unknown index error and
subsequently an invalid argument for the foreach in the
_ValueAlreadyComputed. Dominic K rightly creates an empty array for
conditions in his comment above but perhaps placing a test in the
updateVirtualAggregators statement to avoid a user having to add this
would be great:

[code]
      if (!isset($params['conditions']))
           $params['conditions'] = array();

[/code]

*** Uknown Index with my query ***
Also, I am getting an "invalid index: Event" using the following a
$aggregatingFields array in the Event model using 1.2 RC2. Event is
defined as having many registrations and registration belongs to an
event. The value is shown to be computed correctly and the debug
output shows nothing wrong.

[code]
 var $aggregatingFields = array(
    'registration_count' => array(
      'mode' => 'virtual',
      'key' => 'id',
      'foreignKey' => 'event_id',
      'model' => 'Registration',
      'function' => 'COUNT(Event.id)', // Registration.event_id works
too
    ),
  );
[/code]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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