Log message #4105210

# At Username Text
# Dec 20th 2017, 16:23 spencdev Then after the post, `patchEntity($varNameOfEntity, $this->request->data())`
# Dec 20th 2017, 16:17 spencdev That's typically how it is. Because when you post, you are technically reloading the page. So you should create your entity once, before the `request->is(['post'])` I know that's is 3.x, I can't really remember what the 2.x was
# Dec 20th 2017, 16:16 devito i think what is happening is I am declaring my entity 2x. once on page load and then again on post
# Dec 20th 2017, 16:14 spencdev and also, make sure your form is pointed to the same action that you are using to show the form. In other words, unless you specifically need it to go to another action, leave the `url` option blank.
# Dec 20th 2017, 16:13 spencdev ^ I literally almost had that exact thing typed
# Dec 20th 2017, 16:12 hmic devito: 1. don't redirect on error, 2. make sure you set the actual patched, failed saving, entity to the form at creation time! (or an empty entity on first load without submitting data)
# Dec 20th 2017, 16:11 devito hmm ok. let me take another look.
# Dec 20th 2017, 16:09 dereuromark it should not redirect, but stay on the page, including all errors on the form inputs. and only after success you can redirect away
# Dec 20th 2017, 16:08 dereuromark reloads? then you messed up the form building.
# Dec 20th 2017, 16:07 devito Noticed something odd, after a form submission fails because of Model rules the page doesnt seem to accept the next form post. it reloads the page and the user has to start again. Is there a way to refresh a page after a failed save and cary over the entity errors?
# Dec 20th 2017, 14:56 admad All with* methods return a new instance
# Dec 20th 2017, 14:55 admad @jotpe your example code did not work because you did not assign the return value of withStringBody() to a var.
# Dec 20th 2017, 14:28 vignesh.pattalam yes just realised, I thought you were linking to a plugin initially that did it
# Dec 20th 2017, 14:27 admad it's 3 lines of code to get the list of tables from db
# Dec 20th 2017, 14:26 vignesh.pattalam oh ok, I'll take a closer look then thank you :slightly_smiling_face:
# Dec 20th 2017, 14:26 admad instead of having to do the typing
# Dec 20th 2017, 14:26 admad those are core methods, i just showed you how to use them
# Dec 20th 2017, 14:25 vignesh.pattalam @admad Thank you for that link! So does this mean there is no method in Core CakePHP to find if a table exists in the database ? Is there any plans to bring it to the core or is crud-view going to be the solution for this ?
# Dec 20th 2017, 14:25 jotpe The file isn't existing, should be created from data on the fly
# Dec 20th 2017, 14:25 k4t Here you can also see how I am calling that XYZ action from cURL: https://gist.github.com/K4T/13b01c3d2c572394a390174e6db5697d
# Dec 20th 2017, 14:24 admad https://api.cakephp.org/3.5/class-Cake.Http.Response.html#_withFile
# Dec 20th 2017, 14:23 jotpe @admad, not sure, but withStringBody does not output the content of the file: https://pastebin.com/5uds03gm
# Dec 20th 2017, 14:20 k4t the problem is only when I am calling that XYZ action from cURL from another PHP script
# Dec 20th 2017, 14:19 k4t I can also manually call XYZ action directly from the browser - everything is ok in that situation
# Dec 20th 2017, 14:18 k4t I also checked received cookies from cURL request in XYZ action and I can see that session cookie was sent, but still user session is not visible
# Dec 20th 2017, 14:17 slackebot3 request which are taken from $_SERVER['HTTP_COOKIE']). I can not find why it is not working. Did I miss something?
# Dec 20th 2017, 14:17 k4t I have simple action XYZ in Cake which returns json: { hasAccess: true/false } (depends on whether the user is logged in and has access to resource or not). That XYZ action is called by cURL request invoked from another simple PHP script which is located on the same server under the same domain. My problem is that when I call that XYZ action via that cURL than user session is not visible in XYZ action (I am sending all cookies with that cURL
# Dec 20th 2017, 14:14 jotpe perfect @admad :slightly_smiling_face:
# Dec 20th 2017, 14:13 admad @jotpe ->withStringBody()
# Dec 20th 2017, 14:12 admad @vignesh.pattalam https://github.com/FriendsOfCake/crud-view/blob/master/src/View/Cell/TablesListCell.php#L23
# Dec 20th 2017, 14:10 jotpe hey guys. I want to use $this->response->body(); but it's deprecated and withBody() should be used, which wants a StreamInterface as param. Do i need to implement the StreamInterface in a Class? Is there maybe a implementation yet?
# Dec 20th 2017, 14:08 k4t hello
# Dec 20th 2017, 14:06 vignesh.pattalam Hi, I have a question. Is there any method in CakePHP that tells you if a table exists in the database ? I initially thought TableRegistry::exists() did this, but it doesn't look it that is its functionality
# Dec 20th 2017, 14:06 neon1024 Fair enough, just be mindfull of adding extra dependencies when you don’t need to
# Dec 20th 2017, 14:05 obinoob neon1024 i guess it's all the same the plugin is just easing my instalation troubles
# Dec 20th 2017, 14:03 saeideng no need to any plugin
# Dec 20th 2017, 14:02 saeideng just `CKEDITOR.replace( 'textarea1',{fullPage : false});`
# Dec 20th 2017, 14:01 neon1024 Just used the jQuery adapter
# Dec 20th 2017, 14:01 neon1024 Never needed a helper for CK Editor personally
# Dec 20th 2017, 14:01 obinoob whats the proper way of displaying ckeditor data, all I can get is html which I think is fine but I need to render html I'm using this plugin for cake https://github.com/CakeCoded/CkEditor
# Dec 20th 2017, 13:51 hmic justcharlz: you can catch the exception yourself, or use find->first instead of get, if you expect the id not to exist