# |
Mar 6th 2018, 15:42 |
popperz0r |
ffs |
# |
Mar 6th 2018, 15:42 |
slackebot |
LeadType ON LeadType.id = (UnqualifiedLead.lead_type_id) WHERE (full_name like :c1 AND Email.email like :c2) ORDER BY UnqualifiedLead.id desc``` |
# |
Mar 6th 2018, 15:42 |
popperz0r |
``` (CONCAT(User.first_name, :param0, User.last_name)) AS `full_name` FROM unqualified_lead UnqualifiedLead LEFT JOIN user User ON User.id = (UnqualifiedLead.user_id) LEFT JOIN phone Phone ON Phone.id = (UnqualifiedLead.phone_id) LEFT JOIN email Email ON Email.id = (UnqualifiedLead.email_id) LEFT JOIN city City ON City.id = (UnqualifiedLead.city_id) LEFT JOIN company Company ON Company.id = (UnqualifiedLead.company_id) LEFT JOIN lead_type |
# |
Mar 6th 2018, 15:42 |
popperz0r |
```Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'full_name' in 'where clause'``` |
# |
Mar 6th 2018, 15:42 |
popperz0r |
@jeremyharris after remaking my whole query :( |
# |
Mar 6th 2018, 15:42 |
jeremyharris |
then it’s a problem with whatever is consuming that array. doesn’t change the fact that you should fix your controller :) |
# |
Mar 6th 2018, 15:42 |
flavius |
https://kopy.io/shlHV#line-10 overwrites https://github.com/cakephp/cakephp/blob/2.x/lib/Cake/Controller/Controller.php#L319 |
# |
Mar 6th 2018, 15:41 |
Es0teric |
because when i make it a flat array, the app works as expected |
# |
Mar 6th 2018, 15:41 |
Es0teric |
it is |
# |
Mar 6th 2018, 15:38 |
jeremyharris |
esoteric ok, that’s just a refactoring of your searchByEmail method. the app breaking is not a result of that |
# |
Mar 6th 2018, 15:37 |
flavius |
app crashes because you arent supposed to overwrite `__construct` like that |
# |
Mar 6th 2018, 15:37 |
flavius |
at least call parent::__construct as well :)) |
# |
Mar 6th 2018, 15:37 |
Es0teric |
for some reason |
# |
Mar 6th 2018, 15:37 |
Es0teric |
i want it to be like that but the app crashes |
# |
Mar 6th 2018, 15:37 |
jeremyharris |
or overload the constructor correctly |
# |
Mar 6th 2018, 15:37 |
Es0teric |
jeremyharris https://kopy.io/zP8VA |
# |
Mar 6th 2018, 15:36 |
flavius |
the one that suits you |
# |
Mar 6th 2018, 15:36 |
flavius |
you shouldn't do that, use one of the life cycle callbacks |
# |
Mar 6th 2018, 15:36 |
flavius |
i think because you are overwriting __construct it breaks your app |
# |
Mar 6th 2018, 15:36 |
jeremyharris |
(I think you should fix your controller like @flavius is suggesting though, it might be your actual problem) |
# |
Mar 6th 2018, 15:36 |
Es0teric |
the problem is that i want it to be like this |
# |
Mar 6th 2018, 15:36 |
jeremyharris |
ok so it’s returning an array. what’s the problem, what to do with that array? |
# |
Mar 6th 2018, 15:35 |
Es0teric |
thats the debug() |
# |
Mar 6th 2018, 15:35 |
Es0teric |
jeremyharris https://kopy.io/3wna8 |
# |
Mar 6th 2018, 15:35 |
flavius |
https://book.cakephp.org/2.0/en/controllers.html#request-life-cycle-callbacks |
# |
Mar 6th 2018, 15:35 |
jeremyharris |
still what? do you at least see the array? |
# |
Mar 6th 2018, 15:34 |
Es0teric |
jeremyharris still.. |
# |
Mar 6th 2018, 15:34 |
jeremyharris |
yeah the constructor breaks the controller too, you’re right @flavius |
# |
Mar 6th 2018, 15:34 |
jeremyharris |
sorry my brain is fried today. try `debug();die` |
# |
Mar 6th 2018, 15:34 |
flavius |
i dont think you should be using `public function __construct()` try beforeFilter or any other special cake functions built in |
# |
Mar 6th 2018, 15:33 |
jeremyharris |
`\dd()` maybe you don’t have it, I just noticed it’s cake 2 |
# |
Mar 6th 2018, 15:33 |
Es0teric |
this app is so fucked man... i cant use dd() because its not in the proper namespace... wtf |
# |
Mar 6th 2018, 15:32 |
jeremyharris |
k try debugging. also, the constructor runs the method but doesn’t do anything with the results, is that correct? |
# |
Mar 6th 2018, 15:32 |
Es0teric |
sorry |
# |
Mar 6th 2018, 15:32 |
Es0teric |
jeremyharris i mean this https://kopy.io/shlHV |
# |
Mar 6th 2018, 15:32 |
jeremyharris |
what if you put a `dd($society_list)` right above the return |
# |
Mar 6th 2018, 15:31 |
jeremyharris |
err nm |
# |
Mar 6th 2018, 15:31 |
jeremyharris |
it could be skipping the loop and returning an uninitialized var |
# |
Mar 6th 2018, 15:31 |
jeremyharris |
do you define $society_list before the loop? |
# |
Mar 6th 2018, 15:30 |
Es0teric |
jeremyharris https://kopy.io/kx4uN#line-29 its a little crude but that line 29 pretty much makes the app silently error |
# |
Mar 6th 2018, 15:25 |
jeremyharris |
it shouldn’t fail silently then. maybe nothing’s failing at all? again, just shooting in the dark without seeing anything to go on |