Log message #4204947

# At Username Text
# Sep 21st 2019, 07:37 adam282 Never mind, guess that’s how MySQL does when `NOT NULL` is set for a `varchar`
# Sep 21st 2019, 07:36 adam282 Not sure why name has a `DEFAULT ''` because it shouldn’t.
# Sep 21st 2019, 07:36 slackebot datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `NAME_TYPE` (`name`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ``` The `type` describes what it is for. For instance, `system` is for the actual value while `option` is the JSON object with the options available for a certain parameter generally used in a select field.
# Sep 21st 2019, 07:36 adam282 Ah, yeah, that won’t work. I store the options in a `settings` table with this structure: ``` CREATE TABLE `settings` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'system', `created`
# Sep 21st 2019, 07:34 adam282 Well now that I have everything working… Haha
# Sep 21st 2019, 07:34 admad https://book.cakephp.org/3.0/en/orm/database-basics.html#data-types
# Sep 21st 2019, 07:33 admad also you won't have to bother json decoding yourself if you set the field to `Json` type using `Table::_initializeSchema()`
# Sep 21st 2019, 07:32 admad @adam282 you can simply use `FrozenTime::setJsonEncodeFormat()` and `FrozenTime::setToStringFormat()` to set format you want and avoid having to use Time helper each time
# Sep 21st 2019, 06:51 adam282 I am a big believe of keeping things on few lines as possible. This might be unreadable, but it takes 2 minutes to break it down to different lines to read it.
# Sep 21st 2019, 06:51 adam282 Yes or No? ``` $this->set('option_date_long', json_decode($this->Settings->find('all', ['conditions' => ['name' => 'date_format_long', 'type' => 'option']])->first()['value'], true)); $this->set('option_date_short', json_decode($this->Settings->find('all', ['conditions' => ['name' => 'date_format_short', 'type' => 'option']])->first()['value'], true)); ```
# Sep 21st 2019, 05:55 adam282 Well, I got part way there `Sep 19, 2019 3:10 AM MST` but I guess it’s not possible to add the `th, st, etc` after the day number
# Sep 21st 2019, 05:51 adam282 For example `<?php echo $this->Time->format($user->created, \IntlDateFormatter::SHORT, null, $this->getRequest()->getSession()->read('Auth.User.timezone')); ?>` gives me something like `9/19/19, 3:10:27 AM Mountain Standard Time` where I would rather have `April 9th, 2019 11:46PM`
# Sep 21st 2019, 05:50 adam282 Is it possible to go back to using `date()` formats instead of the I18n formats? I am finding it difficult to achieve what I need.
# Sep 21st 2019, 00:50 adam282 AWS is better for e-mail transport
# Sep 20th 2019, 23:05 itmpls Why is Cake not selecting my `GROUP_CONCAT(submissions_users.user_id)` column when I a `leftJoinWith('SubmissionsUsers')`? In debugKit, the SQL tab I copy *does* show that group_concat column in my sql program
# Sep 20th 2019, 22:52 challgren Ah ok
# Sep 20th 2019, 22:30 maiconpinto @challgren thank you, I think that I changed the flag "x", but in truth, I didn't save. Now, it working correctly.
# Sep 20th 2019, 22:05 challgren @maiconpinto if you have 2 factor auth you may need an app password
# Sep 20th 2019, 21:58 maiconpinto I 'm trying https://book.cakephp.org/3.0/en/core-libraries/email.html#configuring-transports
# Sep 20th 2019, 21:57 maiconpinto Hello! Anybody configure Gmail as Email Transport?
# Sep 20th 2019, 20:13 luizcmarin @challgren I was able to run beta3. Gave error screen ... :,) But I could see that it will be beautiful
# Sep 20th 2019, 20:07 challgren Yeah stick with 3.8 for now til 4.0 is stable
# Sep 20th 2019, 20:07 luizcmarin @admad I will accept your sensible advice. thanks
# Sep 20th 2019, 18:32 daniel.upshaw @ron.rattie that looks like it ought to work
# Sep 20th 2019, 18:24 ron.rattie https://pastebin.com/iDZb6gbf
# Sep 20th 2019, 18:24 ron.rattie If my plugin is properly loaded and this is my and the plugin is named Sites, is this the proper basic routes?
# Sep 20th 2019, 18:24 noel hmm. I can't see anything about exceptions in Crud plugin docs.
# Sep 20th 2019, 18:17 admad the Crud plugin docs should tell you how
# Sep 20th 2019, 18:17 noel Oh :( I don't know how to do that.
# Sep 20th 2019, 18:13 admad configuring the exception renderer through crud component isnt going to work anymore. It needs to be done in Application class
# Sep 20th 2019, 18:12 slackebot HTML `Call to a member function config() on bool`
# Sep 20th 2019, 18:12 noel No I've got that. I think it's that I'm missing the api exception renderer in AppController. But when I try to add it I'm getting a further error, which indicates that Crud is not defined. E.g. `$this->Crud->config(['listeners.api.exceptionRenderer' => 'App\Error\JsonApiExceptionRenderer']);` then the error is `Undefined property: CocktailsController::$Crud in /Users/noeldacosta/repo/crud-test/src/Controller/AppController.php ` followed by more
# Sep 20th 2019, 18:10 admad you are probably missing proper "Accept" header in request
# Sep 20th 2019, 18:07 noel Ok. Thanks I will. Looks like I've been doing it right. I'm getting an unspecified validation error via HTML when I try do the patch. Although the docs seem to indicate I should expect a JSON response containing specific validation errors. What am I missing?
# Sep 20th 2019, 18:06 daniel.upshaw I seem to remember in the issues thread that disabling debug mode helped, so that could easily be what's causing it
# Sep 20th 2019, 18:05 daniel.upshaw I think the next thing I want to try is excluding the debug URL in `permissions.php` if debugging is enabled
# Sep 20th 2019, 18:01 admad consult the json api specs :slightly_smiling_face:
# Sep 20th 2019, 18:00 noel Hi guys. From the JsonApi docs, it's not clear what URL to hit when updating? https://crud-json-api.readthedocs.io/en/latest/api-usage/updating-resources.html Should it be `http://example.com/countries` or http://example.com/countries/10`?
# Sep 20th 2019, 17:56 ricksaccous test
# Sep 20th 2019, 17:48 rochasmarcelo it's a very strange behavior
# Sep 20th 2019, 17:03 daniel.upshaw I noticed that before logging in, the DebugKit box actually displays the login page