# |
Mar 12th 2018, 22:25 |
xinobi |
https://pastebin.com/HFkZNpvD in my view <?= $this->Paginator->sort('UserEmails.address', h('E-Mail')) ?> |
# |
Mar 12th 2018, 22:25 |
savant |
yeah in some cases you are referring to UsersEmails |
# |
Mar 12th 2018, 22:25 |
savant |
ah |
# |
Mar 12th 2018, 22:25 |
savant |
what is in your view? |
# |
Mar 12th 2018, 22:25 |
savant |
not UsersEmails |
# |
Mar 12th 2018, 22:25 |
savant |
the table class is UserEmails |
# |
Mar 12th 2018, 22:24 |
savant |
based on what you showed me |
# |
Mar 12th 2018, 22:24 |
savant |
_also_ it looks like that would be correct |
# |
Mar 12th 2018, 22:24 |
savant |
whats the query generated |
# |
Mar 12th 2018, 22:22 |
xinobi |
savant this is the error Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'UsersEmails.address' in 'order clause' |
# |
Mar 12th 2018, 22:17 |
savant |
what is the _exact_ error you ge |
# |
Mar 12th 2018, 22:17 |
xinobi |
savant the first query runs fine except for pagination query if I hit sort column I get the column not found mysql error |
# |
Mar 12th 2018, 22:16 |
savant |
does that include profiles you want? |
# |
Mar 12th 2018, 22:16 |
savant |
what happens when you run the first query |
# |
Mar 12th 2018, 22:11 |
xinobi |
I can't see all the users that don't have a complete profile ex: if user misses email, phone or address is left out of retrieved pagination query results |
# |
Mar 12th 2018, 22:10 |
savant |
what are the issues you are having? |
# |
Mar 12th 2018, 22:10 |
savant |
okay so on _this_ page |
# |
Mar 12th 2018, 22:09 |
xinobi |
savant https://pastebin.com/jdsLkK9U |
# |
Mar 12th 2018, 21:59 |
savant |
and gist the query for me please |
# |
Mar 12th 2018, 21:59 |
savant |
and then make the query |
# |
Mar 12th 2018, 21:59 |
savant |
make the joinType LEFT |
# |
Mar 12th 2018, 21:58 |
xinobi |
savant with the current setup ->setJoinType('INNER') ->setStrategy('join'); I don't get any sort query error I just can't see users that do not have email or address or phone associated |
# |
Mar 12th 2018, 21:55 |
savant |
for that particular pagination query |
# |
Mar 12th 2018, 21:55 |
savant |
and show me the query it makes |
# |
Mar 12th 2018, 21:55 |
savant |
then run the page |
# |
Mar 12th 2018, 21:55 |
savant |
What I want you to do is use join+LEFT in your models |
# |
Mar 12th 2018, 21:53 |
xinobi |
savant you asked me to show you the query error so i've had to change to 'select' in order to get all the registries including the ones with missing emails or addresses etc |
# |
Mar 12th 2018, 21:53 |
savant |
be back in an hour |
# |
Mar 12th 2018, 21:53 |
savant |
headed out to lunch |
# |
Mar 12th 2018, 21:52 |
savant |
since your query appears to me that its doing a select instead. |
# |
Mar 12th 2018, 21:52 |
savant |
are you sure you left the `UserEmails` strategy and joinType to what you showed in the pastebin? |
# |
Mar 12th 2018, 21:51 |
xinobi |
savant don't follow the url |
# |
Mar 12th 2018, 21:50 |
xinobi |
savant no that :id param is being passed on... this is the url: http://sandbox.lc/teams/users/1?sort=UserAddresses.addressanddirection=asc |
# |
Mar 12th 2018, 21:48 |
savant |
so if there is no JoinedTeam, then it wont show up |
# |
Mar 12th 2018, 21:48 |
savant |
so thats because you are setting team_id to something |
# |
Mar 12th 2018, 21:47 |
xinobi |
savant this is the query https://pastebin.com/1hhK3MjY |
# |
Mar 12th 2018, 21:39 |
savant |
can you show me the query you are seeing |
# |
Mar 12th 2018, 21:39 |
savant |
and leave the joinType as it was |
# |
Mar 12th 2018, 21:39 |
savant |
leave it as join |
# |
Mar 12th 2018, 21:39 |
savant |
do not use select |
# |
Mar 12th 2018, 21:39 |
xinobi |
savant if i choose to use setStrategy('select') than I can see all users but i'm not allowed to sort associated data, I get a mysql error for unknown column (the one I sort) etc |