# |
Sep 20th 2019, 14:17 |
neon1024 |
You might be, I’m not an expert with the plugin having written my own :slightly_smiling_face: |
# |
Sep 20th 2019, 14:16 |
spriz |
I hoped I was missing something obvious :shrug: |
# |
Sep 20th 2019, 14:16 |
spriz |
Yeah, I just feel like this should be easily doable without weird hacks :) |
# |
Sep 20th 2019, 14:16 |
neon1024 |
Perhaps implement your own Writer class which copes with this use-case? |
# |
Sep 20th 2019, 14:15 |
neon1024 |
Maybe ask @savant |
# |
Sep 20th 2019, 14:15 |
spriz |
I could put `0` and make `if (empty($user->image)) { $user->image = null; }` |
# |
Sep 20th 2019, 14:15 |
neon1024 |
So in `beforeMarshal` you could fix the request data |
# |
Sep 20th 2019, 14:15 |
spriz |
I guess so ,:) |
# |
Sep 20th 2019, 14:15 |
neon1024 |
So if you passed a null upload array with `UPLOAD_ERR_OK` set as the error you’d pass the condtion? |
# |
Sep 20th 2019, 14:15 |
neon1024 |
`!== UPLOAD_ERR_OK` |
# |
Sep 20th 2019, 14:14 |
spriz |
but feels bad not just to use the existing `edit($id)` |
# |
Sep 20th 2019, 14:14 |
spriz |
or make a controller action `removeImage($userId)` |
# |
Sep 20th 2019, 14:14 |
spriz |
Hmm, feels so hackish, but I guess that;s the way to go |
# |
Sep 20th 2019, 14:13 |
neon1024 |
Events have that priority number, so you could put your one higher? |
# |
Sep 20th 2019, 14:13 |
spriz |
https://github.com/FriendsOfCake/cakephp-upload/blob/master/src/Model/Behavior/UploadBehavior.php#L90-L96 |
# |
Sep 20th 2019, 14:13 |
neon1024 |
Er, `beforeSave` even maybe |
# |
Sep 20th 2019, 14:13 |
spriz |
it does so in `beforeSave` :S |
# |
Sep 20th 2019, 14:13 |
neon1024 |
`afterMarshal`? |
# |
Sep 20th 2019, 14:13 |
jotpe |
hm |
# |
Sep 20th 2019, 14:13 |
spriz |
the behavior puts the right one back, then :) |
# |
Sep 20th 2019, 14:13 |
neon1024 |
Set the property to null and mark it dirty? |
# |
Sep 20th 2019, 14:12 |
spriz |
Does anyone have a trick to remove the reference to an uploaded file on a table with `josegonzales/cakephp-upload`? I have `image` on `users` table, and want to remove it with patchEntity |
# |
Sep 20th 2019, 14:12 |
luizcmarin |
IMPORTANT Question: After upgrading to version 4, should I regenerate the application? composer create-project --prefer-dist cakephp / app? I imagine you have changed things in that regard as well. How would this line look to recreate the application? |
# |
Sep 20th 2019, 14:03 |
neon1024 |
Well, I mean on a ‘base url’ rather than a controller obviously |
# |
Sep 20th 2019, 14:03 |
daniel.upshaw |
Also tried dc.usersdemo as well |
# |
Sep 20th 2019, 14:03 |
neon1024 |
Can I enable fallback routes on a per controller basis without using a prefix? |
# |
Sep 20th 2019, 14:02 |
daniel.upshaw |
At the moment |
# |
Sep 20th 2019, 14:02 |
daniel.upshaw |
https://localhost:4720/login?redirect=https%3A%2F%2Flocalhost%3A4720%2F |
# |
Sep 20th 2019, 14:01 |
rochasmarcelo |
hey which url you are accessing? |
# |
Sep 20th 2019, 14:01 |
luizcmarin |
A question about updating composer.json: the migration manual says "php composer.phar require --update-with-dependencies" cakephp / cakephp: 4.0. * "" how do i do this in composer.json? => "prefer-stable": true, TO "prefer-stable": false, "?? |
# |
Sep 20th 2019, 13:58 |
graziel |
it all stays in family |
# |
Sep 20th 2019, 13:58 |
daniel.upshaw |
I noticed that _Token[unlocked] is empty |
# |
Sep 20th 2019, 13:58 |
slackebot |
<daniel.upshaw> |
# |
Sep 20th 2019, 13:55 |
daniel.upshaw |
It seems like it should unlock the fields automatically, since it's using the Form component |
# |
Sep 20th 2019, 13:51 |
daniel.upshaw |
Hrmm |
# |
Sep 20th 2019, 13:50 |
rochasmarcelo |
same behavior using the plugin action |
# |
Sep 20th 2019, 13:47 |
daniel.upshaw |
Hmmm, seems to be regenerating something |
# |
Sep 20th 2019, 13:46 |
daniel.upshaw |
The first time |
# |
Sep 20th 2019, 13:46 |
rochasmarcelo |
Yes I removed |
# |
Sep 20th 2019, 13:46 |
daniel.upshaw |
Yeah yours actually match |
# |
Sep 20th 2019, 13:46 |
daniel.upshaw |
Ahh |