# |
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 |
# |
Mar 25th 2019, 20:37 |
marek.sebera |
What is the best way to add BTM connection to existing ones? Because using patchEntity with _ids retrieved before + the new entity id, seems unpractical |
# |
Mar 25th 2019, 20:27 |
challgren |
@feliruc https://github.com/UseMuffin/Footprint |
# |
Mar 25th 2019, 20:22 |
feLiruc |
How can I get the user logged information in the entity? |
# |
Mar 25th 2019, 20:20 |
admad |
there is be first alpha next month |
# |
Mar 25th 2019, 20:20 |
admad |
https://github.com/cakephp/cakephp/wiki/4.0-Roadmap |
# |
Mar 25th 2019, 20:05 |
ricksaccous |
'(mySqlEquation) > 3' |