Logs for #cakephp

Page 6 of 36,420, showing 100 records out of 3,641,957 total, starting on record 501, ending on 600

# At Username Text
# Dec 4th, 13:43 ndm `->orderDesc('MAX(id)')`
# Dec 4th, 13:31 graziel when you do `sql_mode=''` you can change other things also - i dont know which never bothered to check
# Dec 4th, 13:28 dereuromark Too bad this intuitive way of grouping is not allowed (by DB types in general) anymore
# Dec 4th, 13:28 dereuromark @info315 Jep, thats my default usually. But not all users have that.
# Dec 4th, 13:27 dereuromark haha, if you delete the code, the error also goes away. Does not solve it though keeping the functionality (which should be the aim)
# Dec 4th, 13:27 graziel but when you do `->group(['summary', 'id'])` error goes away
# Dec 4th, 13:26 graziel dont ask me im not mastermind behind this change
# Dec 4th, 13:26 info315 @dereuromark you can set `sql_mode=''` :)
# Dec 4th, 13:25 dereuromark wouldnt that kill the idea of grouping?
# Dec 4th, 13:21 graziel what about adding `id` to `->group`
# Dec 4th, 13:13 dereuromark Does anyone have a good idea how you can solve the (annoying) SQL problem of "nonaggreated columns" without losing the order? https://github.com/dereuromark/CakePHP-DatabaseLog/pull/36 I usually silence those as I am too lazy to fix it, but maybe there is a simple and good solution to this.
# Dec 4th, 13:09 noel Probably because I'm using CRUD and I need to inject that into an event listener somewhere rather than just in the action.. lemme see...
# Dec 4th, 13:08 graziel would need to see whole code at this point
# Dec 4th, 13:07 noel hmm... no matter what I put in there it gives the same error; ```Confirm you have created the file: "Customer/Enquiries/index.ctp" in one of the following paths: /Users/noeldacosta/repo/mnr-be/src/Template/Customer/Enquiries/index.ctp```
# Dec 4th, 13:06 graziel so try `setTemplatePath('`Enquiries')``
# Dec 4th, 13:05 graziel then 'setTemplatePath' is relative to it
# Dec 4th, 13:05 graziel iirc in app.php you have setting to templates in general
# Dec 4th, 13:04 noel Cool.. what would go in the path though? I tried all the combinations I could think of. E.g. `'\App\Templates\Enquiries\index.ctp'`, `'\Templates\Enquiries\index.ctp'` , `'\App\Templates\Enquiries'` , , `'\Templates\Enquiries'` , `'\App\Templates\Enquiries\index'`, `'\Templates\Enquiries\index'` .... none of those works.
# Dec 4th, 12:58 graziel maybe ```$this->viewBuilder() ->setTemplatePath('path');```
# Dec 4th, 12:58 info315 You can pass a path like so: `$this->render('/Errors/error403');` maybe this helps
# Dec 4th, 12:57 noel I tried using `$this->render()` but it seems always to default to the subfolder.
# Dec 4th, 12:56 noel Let's say I have a controller in a subfolder: `\App\Controller\Customer\MyController.php` which is an extension of a controller in the main folder `\App\Controller\MyController.php`. Is there a way I can point the extension to the Template of it's parent controller, rather than having to create folders and duplicate Template files?
# Dec 4th, 12:24 neon1024 Looks like some people posted solutions in the comments to get it without a namespace though
# Dec 4th, 12:23 neon1024 Ah, it returns the namespace!
# Dec 4th, 12:23 neon1024 Isn’t that get_class? https://www.php.net/manual/en/function.get-class.php
# Dec 4th, 12:22 admad App::shortName()
# Dec 4th, 12:17 val Hi, is there a function in 3.x that gets the class name of an object stripping a namespace?
# Dec 4th, 11:28 info315 Thanks @ndm, this seems to work: ``` $this->set('error', $command->getErrors()); $this->viewBuilder()->setOption('serialize', ['error']); $this->response = $this->response->withStatus(400); return;```
# Dec 4th, 11:27 ndm And as mentioned the status can then be set by reassigning the response, like `$this->response = $this->response->withStatus(400);`
# Dec 4th, 11:25 ndm Do you really want to stop the controller, or just your controller action logic? In the latter case you can return `null`, this will halt your action logic, but the controller logic will continue and render your view.
# Dec 4th, 11:23 info315 this was the only way i found, to get something else than 200 Ok
# Dec 4th, 11:22 info315 but i don't know how to change the statuscode
# Dec 4th, 11:22 info315 I just want to set the statuscode to 400 and stop controller execution
# Dec 4th, 11:22 ndm Returning a response object from a controller will circumvent the rendering process. You probably just want to reassign the response property.
# Dec 4th, 11:19 slackebot2 $this->response->withStatus(400);```
# Dec 4th, 11:19 info315 I still have issues while i try to set a HTTP status code with cake4 rc2 and respons json output. I try it like this and my status code is 400, but i don't get any response data at all: ``` $CommandsTable->save($command); if ($command->hasErrors()) { $this->set('error', $command->getErrors()); $this->viewBuilder()->setOption('serialize', ['error']); return
# Dec 4th, 10:48 latenal Thanks!
# Dec 4th, 10:28 admad https://book.cakephp.org/3/en/core-libraries/form.html
# Dec 4th, 10:28 admad @latenal use the Form class and set validations for it
# Dec 4th, 10:27 admad You don't need an external lib for something that already exists in core
# Dec 4th, 10:25 admad https://github.com/cakephp/validation
# Dec 4th, 10:24 slackebot2 !awesome
# Dec 4th, 10:24 slackebot2 Command sent from Slack by challgren:
# Dec 4th, 10:24 slackebot2 ! awesome
# Dec 4th, 10:24 slackebot2 Command sent from Slack by challgren:
# Dec 4th, 10:16 latenal Hi! Is there a plugin for upload validation without saving it to the database?
# Dec 4th, 10:07 javier.villanueva sure
# Dec 4th, 10:07 challgren The 2 cat bullied the dog
# Dec 4th, 10:07 javier.villanueva haha
# Dec 4th, 10:07 challgren 2 cats vs 1 dog different story!
# Dec 4th, 10:07 javier.villanueva don't forget to always have food on the plate
# Dec 4th, 10:06 challgren The dog learned cat habits and the cat learned dog habits!
# Dec 4th, 10:06 javier.villanueva always there are exceptions xD
# Dec 4th, 10:06 challgren @javier.villanueva nah! My cat and dog got along well!
# Dec 4th, 10:06 javier.villanueva another tip, you should never mix dogs and cats
# Dec 4th, 10:01 neon1024 My guess is yesterday you were on convention, and has DogsCatsTable and DogsCatsController. I would guess that something has changed with the naming or aliases
# Dec 4th, 10:00 gianmarxgagliardi @spriz it works thanks. I don't understand why yesterday everything went without this line and today it is not
# Dec 4th, 09:57 spriz `var_dump($this->DogsCats)` should give `\App\Model\Table\DogsCatsTable` - or at the very least something like `\Cake\Orm\Table`
# Dec 4th, 09:56 spriz @gianmarxgagliardi have you added `$this->loadModel('
# Dec 4th, 09:54 gianmarxgagliardi I do not understand
# Dec 4th, 09:53 gianmarxgagliardi you can be more specific
# Dec 4th, 09:49 neon1024 This is exactly your error, your table class is not loaded, again. Third time!
# Dec 4th, 09:49 neon1024 This :point_up:
# Dec 4th, 09:49 gianmarxgagliardi if I do a `var_dump` of `$this->DogsCats` gives the following result: `C:\wamp64\www\cake\src\Controller\DogsCatsController.php:21:boolean false`
# Dec 4th, 09:44 gianmarxgagliardi I repeated yesterday evening I had no idea what could have happened I had also put the solution on stack over flow --> https://stackoverflow.com/questions/59141547/cakephp-displays-the-id-display-table-name-from-two-different-tables-with-relati
# Dec 4th, 09:39 gianmarxgagliardi yes -> https://pastebin.com/j4ARkz3s
# Dec 4th, 09:37 jotpe @gianmarxgagliardi does your DogsCatsTable exist?
# Dec 4th, 09:35 jotpe Morning
# Dec 4th, 09:33 gianmarxgagliardi sorry I don't know if it ever happened to any of you, everything worked for me last night. Tell me this screen
# Dec 4th, 08:29 steinkel @nuzulfikrie we opted to provide support for new auth plugins + 4.x and keep AuthComponent for 3.x
# Dec 4th, 07:00 javier.villanueva morning all
# Dec 4th, 05:10 challgren @nuzulfikrie is there a branch support for 3.8 and authentication?
# Dec 4th, 04:20 challgren Yeah I think everyone is going 4.x
# Dec 4th, 04:02 nuzulfikrie Thanks @challgren. Closer look on Github, seems that the Doc is for 4.x, But code i got is 3.x
# Dec 4th, 01:29 challgren You need to use the 9.next branch of CakeDC users I think but that supports CakePHP 4.x
# Dec 4th, 01:23 nuzulfikrie Hi, to integrate CakeDC users and cakephp\authentication . Do i need to load both plugins in Application.php? because in cakedc auth , authentication is not listed as plugin
# Dec 3rd, 20:59 challgren Haha
# Dec 3rd, 20:59 ricksaccous lol
# Dec 3rd, 20:58 ricksaccous @challgren awesome, it's good to know that we are on the same page, it reinforces that my idea is good and I'm a genious
# Dec 3rd, 20:56 challgren Actually I do have one example but its as you said. I create a job with a reference and the notBefore is 5 minutes from the time the jobs created. Then if the user edits the audit between now and 5 minutes it resets the notBefore. Then eventually timesout and sends the quote to the customer
# Dec 3rd, 20:45 challgren Yep thats what I would do
# Dec 3rd, 20:39 ricksaccous i suppose i'd have to create a job with a reference field and keep updating the notBefore date as necessary
# Dec 3rd, 20:39 ricksaccous was thinking of that, i'm using dereuromark queue right now
# Dec 3rd, 20:36 challgren You'd probably need a queue for that
# Dec 3rd, 20:32 ricksaccous has anyone created an event in cakephp to the likening of "after 30 seconds of inactivity run x"?
# Dec 3rd, 20:26 ricksaccous @shifat.it read this a lot https://book.cakephp.org/3/en/orm/query-builder.html
# Dec 3rd, 19:10 brian.french Yeah, that's basically what I ended up doing.
# Dec 3rd, 16:43 noel OMG.. the relief. It's like 2 days of constipation finally over :man-facepalming: and in the end was PEBKAC as usual.
# Dec 3rd, 16:40 noel Turns out I hadn't added the model's table class definition. Is it expected to receive 404 error when there's a class missing?
# Dec 3rd, 16:39 shifat.it https://pastebin.com/135UPfpG
# Dec 3rd, 16:39 shifat.it how to convert this in association
# Dec 3rd, 16:27 noel Seems that was a red-herring anyhow because either side of that logic split I still get a malformed URL :thinking_face:
# Dec 3rd, 16:18 noel It's false by default and in my case it is throwing an error because for some unknown reason it is producing a URL without a controller or action set. I thought it might be this problem: https://crud-json-api.readthedocs.io/en/latest/additional-information/common-issues.html#missing-routes ... but I've added all my models into the routes and it's still happening. So I'm stumped. Have been for 2 days now.
# Dec 3rd, 16:16 noel It's clear that it's used in generating those links but it seems to be a switch, which writes them one way if enabled and another if not and the difference is neither clear nor documented: https://github.com/FriendsOfCake/crud-json-api/blob/382907f1d9cca4fe23fc9113d93bb9ea45037806/src/Schema/JsonApi/DynamicEntitySchema.php#L285
# Dec 3rd, 16:15 noel Yes it does, of course... but the question is what precisely has it to do with them :slightly_smiling_face:
# Dec 3rd, 16:15 josbeir => https://jsonapi.org/format/#document-resource-object-related-resource-links
# Dec 3rd, 16:15 josbeir i'm guessing it has to do with related content links in json:api
# Dec 3rd, 16:13 noel @josbeir Thanks. I have read the spec, however that string `_jsonApiBelongsToLinks` does not appear in the spec. In the CRUD implementation it splits the logic based on that setting but it's not clear why nor what it's doing – the code has no related comments and nor do the docs.
# Dec 3rd, 16:05 sohnyrin That was it, headers problem gone :)