Half-kludgy fix to a filtering bug when a table is already specified using the simple notation, e.g. array('Table'), instead of the more complete form array('Table' => array(...))
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@397 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -328,9 +328,20 @@ class AppController extends Controller {
|
||||
array_merge_recursive($query[$link][$table], $config);
|
||||
}
|
||||
elseif (in_array($table, $query[$link])) {
|
||||
// REVISIT <AP>: 20090727
|
||||
// This presents a dilema. $config may specify fields
|
||||
// as array(), whereas the user has already indicated
|
||||
// they desire ALL fields (by the fact that table is
|
||||
// a member of the query['link'] array without anything
|
||||
// specified). However, $config _could_ specify a
|
||||
// non-standard field in the array, such as using SUM()
|
||||
// or other equation. In that case, we'd have to add
|
||||
// in all the fields of table to the array. That
|
||||
// wouldn't be very hard, but I'll ignore it at the
|
||||
// moment and wait until it's needed.
|
||||
$key = array_search($table, $query[$link]);
|
||||
$query[$link][$key] =
|
||||
array_merge_recursive($query[$link][$key], $config);
|
||||
$query[$link][$table] = array('fields' => null) + $config;
|
||||
unset($query[$link][$key]);
|
||||
}
|
||||
else {
|
||||
// Table is NOT already part of the query... set it now
|
||||
|
||||
Reference in New Issue
Block a user