# |
Nov 30th 2017, 17:43 |
dereuromark |
error handling / middleware |
# |
Nov 30th 2017, 17:43 |
inoas |
where in the tools plugin to look about? |
# |
Nov 30th 2017, 17:42 |
inoas |
it worked for an older app but now doesnt work anymore |
# |
Nov 30th 2017, 17:42 |
inoas |
https://gist.github.com/inoas/8e4f9646cbc836bcca15a4790aac801e/edit |
# |
Nov 30th 2017, 17:42 |
inoas |
I am already doing that |
# |
Nov 30th 2017, 17:41 |
inoas |
also possibly for MissingActionException |
# |
Nov 30th 2017, 17:37 |
dereuromark |
it is also outlined in the sandbox best practices: http://sandbox.dereuromark.de/pages/best-practices#logging |
# |
Nov 30th 2017, 17:36 |
dereuromark |
of course, see tools plugin |
# |
Nov 30th 2017, 17:33 |
inoas |
I want to route all Cake\Network\Exception\NotFoundException somewhere |
# |
Nov 30th 2017, 17:29 |
inoas |
dereuromark didn't you have some solution on how to log 404 to separate files? |
# |
Nov 30th 2017, 16:02 |
hmic |
IMHO |
# |
Nov 30th 2017, 16:02 |
hmic |
you only need to provide one - the one that *not* matches the current scope |
# |
Nov 30th 2017, 16:02 |
casmo |
err, field names |
# |
Nov 30th 2017, 16:02 |
casmo |
You will get an mysql error if you have a join with the same table names |
# |
Nov 30th 2017, 16:01 |
hmic |
actually i think the orm does exactly that on its own, if you only provide a field name, no . to designate an alias - it adds the currently scoped alias |
# |
Nov 30th 2017, 15:59 |
hmic |
especially in a behavior that can be attached on different tables, you should absolutely use the correct alias and not a fixeed name |
# |
Nov 30th 2017, 15:59 |
casmo |
But I understand what you mean |
# |
Nov 30th 2017, 15:58 |
casmo |
Yeah, I'm thinking when I use it, the Owner I have on my Group as a behavior. But the custom queries are in that behvior as well and using just 'Owners.field_x' |
# |
Nov 30th 2017, 15:58 |
hmic |
and once you did, you better stay save and use the format everywhere ;-) |
# |
Nov 30th 2017, 15:58 |
hmic |
i use that pretty often |
# |
Nov 30th 2017, 15:58 |
hmic |
so you alias the user association differently, does not neet to be multiple associations, just by another name |
# |
Nov 30th 2017, 15:57 |
casmo |
Oke, point taken |
# |
Nov 30th 2017, 15:57 |
hmic |
or a user can be a owner of something |
# |
Nov 30th 2017, 15:57 |
hmic |
in an email app, a user can be aliased as a sender or receiver of a message |
# |
Nov 30th 2017, 15:57 |
casmo |
What kind of Aliases do you have for that? |
# |
Nov 30th 2017, 15:57 |
unclezoot |
yeah that worked, thanks guys |
# |
Nov 30th 2017, 15:57 |
hmic |
e.g. UsersTable |
# |
Nov 30th 2017, 15:56 |
casmo |
Give me an example |
# |
Nov 30th 2017, 15:56 |
hmic |
quite often actually, IMHO |
# |
Nov 30th 2017, 15:56 |
hmic |
casmo, needed everywhere where you use different aliases on the table |
# |
Nov 30th 2017, 15:54 |
casmo |
Mavisakalian: I can't help you with that error alone, can be anything |
# |
Nov 30th 2017, 15:54 |
casmo |
Only needed for queries that are in models with multiple associations under different names, no? |
# |
Nov 30th 2017, 15:54 |
casmo |
But I don't like to read it like that, tough |
# |
Nov 30th 2017, 15:54 |
casmo |
Even better yeah :) |
# |
Nov 30th 2017, 15:52 |
h.mavisakalian |
any thoughts on that warning ? |
# |
Nov 30th 2017, 15:51 |
hmic |
casmo, preferably with the correct alias, like: sprintf('%s.publish_to IS', $this->alias) :P |
# |
Nov 30th 2017, 15:50 |
casmo |
Posts.publish_to IS |
# |
Nov 30th 2017, 15:50 |
unclezoot |
(a LOT simpler) |
# |
Nov 30th 2017, 15:50 |
casmo |
Yeah, preferbly with Tablename in front of it |
# |
Nov 30th 2017, 15:50 |
unclezoot |
ill give it a go, thanks |
# |
Nov 30th 2017, 15:49 |
hmic |
you can just ->where(['publish_to IS' => null]) |