You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the last join table fields (AdminUsers) are used. Other join table fields
(UsersPerson, PersonsComm and UserCommChannels) are not present in select.
I think I found the problem in Doctrine.php, line 921, _setFromParts():
0 Array [4]
alias (string:2) pc
tableModel (string:21) Model_UserPersonComms
tableAlias (string:12) PersonsComms
joinOn (string:2) ab
As you can see, this join has numeric key, and array_merge overwrites the previous
join. At the end, only the last join table has left.
My current solution for this issue is:
Use array_merge_recursive,
in _explodeJoin(), on line 1069 instead of
$return['join'][strtolower($joinType)][] = array(
use
$return['join'][strtolower($joinType)][$alias] = array(
in _findAndSetSelect(), on line 957 surround $this->_setFromParts(); with
if (count($this->_queryParts['from']) == 0) {
$this->_setFromParts();
}
_findAndSetSelect() is calling _setFromParts() even though it is already set, and,
for some reason, the second pass throws Loader exception "Table.php" not found.
Please take a look, and I hope this workaround might help you to solve it.
With this "dirty" workaround, I get all the fields, no notices, all nice, except:
The query above, because of its left joins (hasMany), for some rows in Addressbook
returns several rows. Like
John email me@me
John mobile 2233
John home 4422 etc.
SQL and Doctrine query work correctly, but grid displays the incorrect number of
rows, both in pagination and on the screen.
Grid displays as there is just one "John", and not as in this case three.
In fact, grid displays the number of rows in main table (Addressbook), and not what
the query returns in reality.
Before this workaround, it worked correctly, but it is because all but last joined
tables fields were left out.
Original author: [email protected] (March 29, 2010 14:15:22)
Create a doctrine query with a left join and specify certain fields in the
select. Then try to do an Edit action on one of the rows and it will fail.
I have found to solution to this, i just need to test it and commit it.
The ticket is purely a reminder for me about this issue.
Original issue: http://code.google.com/p/zfdatagrid/issues/detail?id=233
The text was updated successfully, but these errors were encountered: