Log message #4096533

# At Username Text
# Nov 14th 2017, 08:32 admad "I'm using a Controller to redirect to an other controller wihch has the form in its template" your mean using $this->redirect() for ajax request? If so don't do that. Check for success/failure on client side and do redirect there
# Nov 14th 2017, 08:27 admad the cookie is the "source of truth" and holds value to compare against. So the value for comparing needs to be either in POST data or X-CSRF-Token header
# Nov 14th 2017, 08:21 sniedermaier @admad found the problem I'm using a Controller to redirect to an other controller wihch has the form in its template. The redirect kills the _csrfToken-Param which is needed to create the input for it. Is there any reason why the param is used and not the Cookie?
# Nov 14th 2017, 08:07 slackebot2 type="hidden"></div> <div class="hidden"> <input name="_csrfToken" value="258038723e6b8b25e3ab26c3b155191bc36749dff14c38884a1044489d405be91d96d9c003eca5027e2993788dfb3fd74cbb0e3f75eb66699cddb8b919c60f12"> </div>```
# Nov 14th 2017, 08:07 sniedermaier @admad when i open the `form` in its own window (not using ajax) the field is there ``` <form method="post" accept-charset="utf-8" role="form" action="/content/menus/pagetree/136"><div class="hidden"><input name="_method" value="PUT" type="hidden"><input name="_csrfToken" autocomplete="off" value="258038723e6b8b25e3ab26c3b155191bc36749dff14c38884a1044489d405be91d96d9c003eca5027e2993788dfb3fd74cbb0e3f75eb66699cddb8b919c60f12"
# Nov 14th 2017, 07:57 sniedermaier its on Cake 3.5.5
# Nov 14th 2017, 07:56 sniedermaier well, yea, that's what i expect too ... FormStart `echo $this->Form->create($pageContent);` Markup: `<form method="post" accept-charset="utf-8" role="form" action="/content/menus/pagetree/136"><div class="hidden"><input name="_method" value="PUT" type="hidden"></div>`
# Nov 14th 2017, 07:52 admad a form created using form helper should already have csrf token field
# Nov 14th 2017, 07:16 sniedermaier I'm loading a form via ajax into my page and using POST to send the form data to a new tab. I'm getting a csrf-Token mismatch, cause the field is missing in my form (I'm using `$this->Form->create()`). Any explanation why this happens? Do i have to add the CSRF-field manually?
# Nov 14th 2017, 05:55 ono-t :sunny:
# Nov 14th 2017, 04:41 admad String is a protected keyword in php 7. Use CakeText instead
# Nov 14th 2017, 04:20 aro This is on PHP 7, is it not supported?
# Nov 14th 2017, 04:20 aro i am using cake 2.10.4, and i am getting an error: Class 'String' not found
# Nov 14th 2017, 02:45 thomasnucleus How can I actually debug issues with my pdf generation with Cakepdf? I'
# Nov 14th 2017, 01:51 voycey But generally if you need it in one place you will need it in several eventually - so there are things like this that make it easy: https://github.com/UseMuffin/Trash
# Nov 14th 2017, 01:46 voycey but basically you can just force it to not find deleted records - you dont have to test for it do you?
# Nov 14th 2017, 01:45 voycey ^im lying - I did in the table as a finder
# Nov 14th 2017, 01:40 voycey You can filter that in an entity better
# Nov 14th 2017, 01:00 ppisecky How can I check if a condition has been set inside the `beforeFind` event handler?
# Nov 14th 2017, 00:01 ppisecky File uploaded https://cakesf.slack.com/files/U7HK6RAUW/F80PGQLNB/query_only_not_deleted_rows.php / https://slack-files.com/T053DPNCM-F80PGQLNB-134a8d8176
# Nov 14th 2017, 00:00 ppisecky The best place to do this seems to be inside the `beforeFind` event listener method of the class inheriting from `Table` but I don't know how to do it
# Nov 13th 2017, 23:59 ppisecky In other words I always want to query rows with `deleted` set to false unless specified as above
# Nov 13th 2017, 23:57 ppisecky File uploaded https://cakesf.slack.com/files/U7HK6RAUW/F7ZM24KA6/finding_deleted_rows.php / https://slack-files.com/T053DPNCM-F7ZM24KA6-12c25793b4 - Always look for not deleted rows unless specified otherwise as above for example
# Nov 13th 2017, 23:55 ppisecky I want to always query the rows that have the `delete` flag set to false unless the query has already had conditions applied to that particular column
# Nov 13th 2017, 23:53 ppisecky The table has a `delete` column which is just true/false
# Nov 13th 2017, 23:53 ppisecky I am trying to implement a very simple soft delete functionality for one table
# Nov 13th 2017, 23:52 ppisecky Hey guys I need advice
# Nov 13th 2017, 21:36 grzegorek.rafal :slightly_smiling_face:
# Nov 13th 2017, 21:35 dereuromark => solve https://github.com/cakephp/migrations/issues/333 => then you got your dry run
# Nov 13th 2017, 21:34 grzegorek.rafal @dereuromark Yep - I was asking strictly about migration plugin - I know "--dry-run" from Phinx. :slightly_smiling_face:
# Nov 13th 2017, 21:33 dereuromark I think this comes with phinx 0.9 however, cake still uses 0.81.
# Nov 13th 2017, 21:31 dereuromark if this option is not available in migrations plugin, someone could implement this as PR to forward the --dry-run option :slightly_smiling_face:
# Nov 13th 2017, 21:30 dereuromark or rather https://github.com/cakephp/phinx/pull/1127 then
# Nov 13th 2017, 21:29 dereuromark a bit of googling reveals a lot: https://github.com/cakephp/phinx/issues/906
# Nov 13th 2017, 21:28 grzegorek.rafal Is it possible to do "run dry" using bin/cake migrations plugin to see what SQL will be applied?
# Nov 13th 2017, 20:50 saeideng .
# Nov 13th 2017, 20:45 Azee https://irc.cakephp.org/
# Nov 13th 2017, 20:45 Azee @Azee
# Nov 13th 2017, 20:45 Azee <br>
# Nov 13th 2017, 20:45 saeideng yes
# Nov 13th 2017, 20:45 Azee Oué oué