Menu

#21 operators in beforeFind changed in cake 1.2

open
nobody
5
2009-06-19
2009-06-19
Anonymous
No

In the current Cake Version all operators used in conditions moved to the 'key' side. So you have to change the before find method and move the operators to get the behavior working correctly.
Here I have the correct code (if statement in the beforeFind):

if (is_string($queryData['conditions']))
{
$queryData['conditions'] = $Db->name($Model->alias) . '.' . $Db->name($this->__settings[$Model->alias]['field'] . ' !=') . '1 AND ' . $queryData['conditions'];
}
else
{
$queryData['conditions'][$Model->alias . '.' . $this->__settings[$Model->alias]['field'] . ' !='] = '1';
}

Discussion


Log in to post a comment.