# |
May 25th 2016, 17:51 |
nemmons |
so the best advice that I could give would be to dig into CakePHP and try to understand exactly how the SQL is being constructed and whether it's possible to influence the order of the joins |
# |
May 25th 2016, 17:51 |
a.barclay |
Looks like it, yeah. |
# |
May 25th 2016, 17:51 |
nemmons |
So the problem is that the SQL is being generated in such a way that the order of the joins is 'incorrect' (meaning that it leads to a query that doesn't work) |
# |
May 25th 2016, 17:49 |
a.barclay |
and this only seems to error when paginating. For instance, if I go to /jobs/add, in the "Account Manager" drop down I only get users who have the User Type "Account Manager" |
# |
May 25th 2016, 17:48 |
a.barclay |
But obviously "Account Managers" is a aliased association with a custom finder, so I'm wondering if something there is messing it up. |
# |
May 25th 2016, 17:47 |
a.barclay |
Yeah, I'm just not sure where in my code I've gone wrong. As far as I'm aware, the association between Users and UserTypes is correct. |
# |
May 25th 2016, 17:45 |
nemmons |
i guess it's supposed to be inner joining UserTypes first |
# |
May 25th 2016, 17:45 |
a.barclay |
yeah I just noticed that too |
# |
May 25th 2016, 17:45 |
nemmons |
a.barclay interesting. so on like 15 it's trying to join jobs on account_managers but then it's referencing user_types in the ON clause, so there's definitely a problem there |
# |
May 25th 2016, 17:42 |
a.barclay |
@nemmons: Ok, I had to hack the MysqlStatement.php file to get it to output all the queries, and here they are: http://pastebin.com/f6Hn1YyJ |
# |
May 25th 2016, 17:40 |
nemmons |
there are a couple examples at the bottom of this section: http://book.cakephp.org/3.0/en/views/helpers/html.html#creating-links |
# |
May 25th 2016, 17:39 |
nemmons |
mrfeedback have you tried using Html->url instead, and passing `['escape' => false]` as the third parameter? |
# |
May 25th 2016, 17:37 |
mrfeedback |
(via js) like ##id## |
# |
May 25th 2016, 17:36 |
mrfeedback |
actually i am trying to build a placeholder which then will be replaced |
# |
May 25th 2016, 17:36 |
a.barclay |
I can't see the query on the error page. I can try and dump the SQL query, give me 2 minutes :) |
# |
May 25th 2016, 17:35 |
nemmons |
a.barclay i forget, with an error like this does the debugtoolbar still load and show you the query? if not, is there anyway to debug the sql query before it's executed |
# |
May 25th 2016, 17:35 |
mrfeedback |
oh sorry i meant $this->Url->build helper |
# |
May 25th 2016, 17:34 |
mrfeedback |
is there a way to add # to a link with the html link helper? at the moment it always escapes me the # to %23 |
# |
May 25th 2016, 17:32 |
a.barclay |
It's a difficult one it seems! Here is some background: http://discourse.cakephp.org/t/paginator-not-working-with-custom-finder/382 |
# |
May 25th 2016, 17:31 |
nrother |
depends on your problem ;) |
# |
May 25th 2016, 17:29 |
a.barclay |
Anyone available who can help with a Paginator issue? |
# |
May 25th 2016, 17:19 |
Human_G33k |
*know |
# |
May 25th 2016, 17:18 |
Human_G33k |
do you why and if i should gitignore vendor/* ? |
# |
May 25th 2016, 17:01 |
ionas |
In case anyone is up for board games I got Spyfall, Good Cop Bad Cop, Cockroach Poker and Cosmic Encounter with me. just highlight/pm me here or on facebook |
# |
May 25th 2016, 16:47 |
ionas |
anyone up for some board or card games tonite? |
# |
May 25th 2016, 16:41 |
ionas |
query for a sec |
# |
May 25th 2016, 16:41 |
ionas |
yeah it also took me 30mins to get online after getting here because I am just tired |
# |
May 25th 2016, 16:41 |
ionas |
lol |
# |
May 25th 2016, 16:40 |
hmic |
i've spend hundreds on ebay in the meantime... |
# |
May 25th 2016, 16:40 |
hmic |
wow, took longer than expected... |
# |
May 25th 2016, 16:38 |
ionas |
hmic: finally at my place |
# |
May 25th 2016, 16:33 |
ypnos |
$this->connection()->newQuery()->select(1); this works |
# |
May 25th 2016, 16:32 |
ypnos |
Uncaught Error: Call to a member function sql() on string in /srv/http/LIMS/app/vendor/cakephp/cakephp/src/Database/QueryCompiler.php:274 |
# |
May 25th 2016, 16:31 |
ypnos |
no it doesn't it gives a "can't do stuff on string" error |
# |
May 25th 2016, 16:29 |
nemmons |
@ypnos i think ->union("SELECT 1") should work? |
# |
May 25th 2016, 16:26 |
ypnos |
how to do that.. basically having ->union(â?¦) where â?¦ is a Query object that only contains "SELECT 1" |
# |
May 25th 2016, 16:25 |
ypnos |
I want to add UNION (SELECT 1) to a query |
# |
May 25th 2016, 15:15 |
phpcoder |
why the conditions of a table i used on through option of an association of another table i not used |
# |
May 25th 2016, 14:28 |
hmic |
?! |
# |
May 25th 2016, 14:28 |
flangofas |
thanks guys :) |
# |
May 25th 2016, 14:27 |
flangofas |
hmic: next time, i will stick the reason too :) |