# |
Aug 15th 2019, 10:21 |
challgren |
Custom error handler during tests |
# |
Aug 15th 2019, 10:20 |
neothermic |
well, no, that only tells me _why_ it's writing to stderr, not how to stop it from doing so :) |
# |
Aug 15th 2019, 10:20 |
challgren |
Well that sounds like your fix! |
# |
Aug 15th 2019, 10:18 |
neothermic |
and in a console context, that writes to stderr |
# |
Aug 15th 2019, 10:18 |
neothermic |
which passes to ErrorHandler::handleError |
# |
Aug 15th 2019, 10:18 |
neothermic |
ahh, so I'm using cake's default error handler |
# |
Aug 15th 2019, 10:17 |
challgren |
Im trying to see where it even echos out |
# |
Aug 15th 2019, 10:17 |
neothermic |
file |
# |
Aug 15th 2019, 10:17 |
challgren |
Whats your engine? |
# |
Aug 15th 2019, 10:16 |
neothermic |
when you omit the scope, the type is used as the scope |
# |
Aug 15th 2019, 10:15 |
neothermic |
`CakeLog::write('error', '<some message>');` |
# |
Aug 15th 2019, 10:15 |
neothermic |
it's an error scope, FWIW |
# |
Aug 15th 2019, 10:15 |
challgren |
Im trying to recall what I did but I think it was scoping. To fix that |
# |
Aug 15th 2019, 10:14 |
neothermic |
so the logging is expected, but it being to the screen.. is not :P |
# |
Aug 15th 2019, 10:14 |
neothermic |
I'm intentionally checking paths that generate logs/return false/throw exceptions |
# |
Aug 15th 2019, 10:14 |
slackebot |
<challgren> |
# |
Aug 15th 2019, 10:14 |
neothermic |
PITA to see |
# |
Aug 15th 2019, 10:13 |
challgren |
Is it causing errors? Or just PITA to see |
# |
Aug 15th 2019, 10:13 |
neothermic |
nah, but ideally I don't want to change the code that I'm testing :S |
# |
Aug 15th 2019, 10:13 |
challgren |
Did you try scoping the write? |
# |
Aug 15th 2019, 10:12 |
neothermic |
heh |
# |
Aug 15th 2019, 10:12 |
challgren |
I thought you had cake 2 on cake 3 on cake 1! :P |
# |
Aug 15th 2019, 10:12 |
neothermic |
can we keep the jokes about 2.x being old until after it gets dropped from support? :P |
# |
Aug 15th 2019, 10:09 |
challgren |
@mrfeedback thanks for the sample! I was trying to figure out Policies |
# |
Aug 15th 2019, 10:09 |
mrfeedback |
thank you! |
# |
Aug 15th 2019, 10:09 |
mrfeedback |
oh man! you saved me again! overlooked that completley |
# |
Aug 15th 2019, 10:04 |
ndm |
@mrfeedback ``` // Policy/CollectionsTablePolicy.php namespace App\Policy; namespace App\Model\Table\CollectionsTable; // <<<<<<<<<< that's not supposed to be there ``` |
# |
Aug 15th 2019, 09:59 |
mrfeedback |
I could need some advice why I get this error thrown `Error: [Authorization\Policy\Exception\MissingPolicyException] Policy for `App\Model\Table\CollectionsTable` has not been defined.` I am sure I missunderstood something in docs |
# |
Aug 15th 2019, 09:58 |
ndm |
@jotpe You can authorize against anything that your policy resolvers can provide a policy for... with the default ORM resolver you can authorize entities, tables, and queries (which is basically tables). So you may want to look into a table policy. |
# |
Aug 15th 2019, 09:58 |
slackebot |
<challgren> |
# |
Aug 15th 2019, 09:55 |
slackebot |
<neon1024> |
# |
Aug 15th 2019, 09:54 |
challgren |
cake 2.x?? |
# |
Aug 15th 2019, 09:15 |
neothermic |
(in cake2) |
# |
Aug 15th 2019, 09:15 |
neothermic |
is there any way to get Cakelog::write to not echo to stdout when running unit tests? |
# |
Aug 15th 2019, 09:14 |
lubos |
@admad found the reason, when you do `formatResults` with finder on associated model (e.g. Offers) it sets `offer` property as dirty even when no change is done to `$results` so later on when I tried to save it was trying to save `offer` property which I did not expect :slightly_smiling_face: |
# |
Aug 15th 2019, 09:09 |
neon1024 |
Ah, I knew if I asked, I’d find it right away! https://github.com/dereuromark/cakephp-hashid |
# |
Aug 15th 2019, 09:09 |
neon1024 |
Anyone know where dereuromark’s plugin is which adds an obfuscation slug layer |
# |
Aug 15th 2019, 09:04 |
jotpe |
https://book.cakephp.org/authorization/1.1/en/checking-authorization.html -> there it's checked with the entity `$user->can('delete', $article)` |
# |
Aug 15th 2019, 09:03 |
jotpe |
In fact i want to enable an admin user to access all actions in a controller. But in an index action i don't have an entity |
# |
Aug 15th 2019, 09:02 |
jotpe |
How do i check the authorization for a index action in Authroization Plugin? |
# |
Aug 15th 2019, 08:41 |
spriz |
not afaik |