# |
Mar 26th 2019, 11:24 |
ondrej.nedvidek |
oh I see .. thanks for hint ;) |
# |
Mar 26th 2019, 11:21 |
dereuromark |
but they would still be merged together, as they contain different data, that is not an issue for you. |
# |
Mar 26th 2019, 11:20 |
dereuromark |
it would still be the same file, just two sections (top vs bottom), usually. you can use multiple files if you want to, as per docs. |
# |
Mar 26th 2019, 11:16 |
ondrej.nedvidek |
@dereuromark Hi Mark, I would like to use TinyAuth for frontend and admin. So there will be admin acl.ini and frontend acl.ini. How would you set the config for this? I mean, bootstrap does not seem to be option as I need to load one or other, depends what controllers are called. |
# |
Mar 26th 2019, 10:47 |
challgren |
You cant use both https://book.cakephp.org/3.0/en/controllers/middleware.html#cross-site-request-forgery-csrf-middleware |
# |
Mar 26th 2019, 10:40 |
challgren |
Pick either Application.php middleware stack or Routing scope. |
# |
Mar 26th 2019, 10:40 |
challgren |
There’s where your Csrf Middleware is being added, set your config there too |
# |
Mar 26th 2019, 10:39 |
scuadra |
this is at the top of Router::scope |
# |
Mar 26th 2019, 10:39 |
scuadra |
$routes->registerMiddleware('csrf', new CsrfProtectionMiddleware()); |
# |
Mar 26th 2019, 10:38 |
challgren |
Check in your routes.php |
# |
Mar 26th 2019, 10:37 |
scuadra |
@challgren, I am not using any specific plugins |
# |
Mar 26th 2019, 10:34 |
challgren |
Morning @neon1024 |
# |
Mar 26th 2019, 10:29 |
neon1024 |
The component has been replaced by the MIddleware. Perhaps that’s where your confusion is |
# |
Mar 26th 2019, 10:28 |
neon1024 |
So you’re using the CSRF Middleware and getting a CSRF error :thinking_face: |
# |
Mar 26th 2019, 10:28 |
neon1024 |
Morning all |
# |
Mar 26th 2019, 10:24 |
challgren |
What plugins you using? |
# |
Mar 26th 2019, 10:17 |
scuadra |
How to fix this error? |
# |
Mar 26th 2019, 10:17 |
scuadra |
Hi all. In Cake 3.7 i am getting error CSRF token mismatch doing POST request. I am not using CSRF component as suggested here (https://stackoverflow.com/questions/52326038/cakephp-3-6-csrf-token-mismatch-in-post-request). I only have ->add(new CsrfProtectionMiddleware(['httpOnly' => true])) in middleware() function in src/Application.php. |
# |
Mar 25th 2019, 21:10 |
chrisshick |
I would think it would build the query and let MySQL return the result |
# |
Mar 25th 2019, 21:09 |
ricksaccous |
if you are just connecting records, then it depends on how the form looks, but i don't see a problem with patchEntity @marek.sebera |
# |
Mar 25th 2019, 21:08 |
marek.sebera |
cool, no problem |
# |
Mar 25th 2019, 21:08 |
chrisshick |
Yeah... it seems the subquery executes first and then cake injects into the main query |
# |
Mar 25th 2019, 21:08 |
ricksaccous |
yeah that's kind of a weird use case i guess, wew |
# |
Mar 25th 2019, 21:08 |
ricksaccous |
oh |
# |
Mar 25th 2019, 21:08 |
chrisshick |
For cake |
# |
Mar 25th 2019, 21:08 |
ricksaccous |
take a look at query expressions i think that would help |
# |
Mar 25th 2019, 21:07 |
chrisshick |
I noticed that the default way subqueries work is that they are executed first and then injected into the main query |
# |
Mar 25th 2019, 21:07 |
ricksaccous |
yeah there is |
# |
Mar 25th 2019, 21:07 |
chrisshick |
Is there a way to run a subquery that uses data from the main query? |
# |
Mar 25th 2019, 21:07 |
ricksaccous |
and you wanted to connect the old records that weren't connected yet |
# |
Mar 25th 2019, 21:06 |
ricksaccous |
i thought you had an old dataset and you just added in this relationship |
# |
Mar 25th 2019, 21:06 |
ricksaccous |
oh i think i was confused |
# |
Mar 25th 2019, 21:02 |
marek.sebera |
or I don't understand what you're asking for |
# |
Mar 25th 2019, 20:58 |
marek.sebera |
they are already contained in join-table, in action where user can upload new file to existing document, i create physically and validate the file, and add the file entity to document entity link using the described way |
# |
Mar 25th 2019, 20:53 |
ricksaccous |
was the data hasMany before? |
# |
Mar 25th 2019, 20:53 |
ricksaccous |
and how do you know how to assign them based on existing data? |
# |
Mar 25th 2019, 20:52 |
marek.sebera |
well i have `document BTM files`, as one document (along with more associations) can consist of multiple physical files, and files can be assigned within multiple documents, standard BTM relation i think |
# |
Mar 25th 2019, 20:49 |
ricksaccous |
i don't really understand the nature of your associations but you might be able to just put this together with sql, but yeah, that might hurt the caching however you have that set up |
# |
Mar 25th 2019, 20:48 |
marek.sebera |
@ricksaccous now I collect existing ids iterating association field, add the id of new entity i've created before, patchEntity and save, but I felt there must be a better way |
# |
Mar 25th 2019, 20:47 |
ricksaccous |
@marek.sebera, depends on your use case, patchEntity in a loop doesn't sound too crazy as a one-off script |
# |
Mar 25th 2019, 20:38 |
marek.sebera |
maybe adding new record into BTM join-table, but that might break some in-cakephp caching |