Logs for #cakephp

Page 4 of 36,308, showing 100 records out of 3,630,750 total, starting on record 301, ending on 400

# At Username Text
# Sep 21st, 07:55 admad i thought you were making an API for js frontend :slightly_smiling_face:
# Sep 21st, 07:54 adam282 Now if I could figure out how to set `itemWithoutLink`, I’d be good
# Sep 21st, 07:54 adam282 Haha, nice! Thank you.
# Sep 21st, 07:53 admad or simply call that method after loading method
# Sep 21st, 07:52 admad use config/options array when loading helper in AppView::initialize()
# Sep 21st, 07:52 challgren I think you can config it in your appview
# Sep 21st, 07:50 adam282 Is it possible to set something like this app wide instead of in each view template? ``` $this->Breadcrumbs->setTemplates([ 'wrapper' => '<nav aria-label="breadcrumb"><ol class="breadcrumb">{{content}}</ol></nav>', 'item' => '<li class="breadcrumb-item"><a href="{{url}}">{{title}}</a></li>' ]); ```
# Sep 21st, 07:37 adam282 Never mind, guess that’s how MySQL does when `NOT NULL` is set for a `varchar`
# Sep 21st, 07:36 adam282 Not sure why name has a `DEFAULT ''` because it shouldn’t.
# Sep 21st, 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, 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, 07:34 adam282 Well now that I have everything working… Haha
# Sep 21st, 07:34 admad https://book.cakephp.org/3.0/en/orm/database-basics.html#data-types
# Sep 21st, 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, 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, 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, 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, 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, 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, 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, 00:50 adam282 AWS is better for e-mail transport
# Sep 20th, 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, 22:52 challgren Ah ok
# Sep 20th, 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, 22:05 challgren @maiconpinto if you have 2 factor auth you may need an app password
# Sep 20th, 21:58 maiconpinto I 'm trying https://book.cakephp.org/3.0/en/core-libraries/email.html#configuring-transports
# Sep 20th, 21:57 maiconpinto Hello! Anybody configure Gmail as Email Transport?
# Sep 20th, 20:13 luizcmarin @challgren I was able to run beta3. Gave error screen ... :,) But I could see that it will be beautiful
# Sep 20th, 20:07 challgren Yeah stick with 3.8 for now til 4.0 is stable
# Sep 20th, 20:07 luizcmarin @admad I will accept your sensible advice. thanks
# Sep 20th, 18:32 daniel.upshaw @ron.rattie that looks like it ought to work
# Sep 20th, 18:24 ron.rattie https://pastebin.com/iDZb6gbf
# Sep 20th, 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, 18:24 noel hmm. I can't see anything about exceptions in Crud plugin docs.
# Sep 20th, 18:17 admad the Crud plugin docs should tell you how
# Sep 20th, 18:17 noel Oh :( I don't know how to do that.
# Sep 20th, 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, 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, 18:12 slackebot HTML `Call to a member function config() on bool`
# Sep 20th, 18:10 admad you are probably missing proper "Accept" header in request
# Sep 20th, 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, 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, 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, 18:01 admad consult the json api specs :slightly_smiling_face:
# Sep 20th, 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, 17:56 ricksaccous test
# Sep 20th, 17:48 rochasmarcelo it's a very strange behavior
# Sep 20th, 17:03 daniel.upshaw I noticed that before logging in, the DebugKit box actually displays the login page
# Sep 20th, 17:03 daniel.upshaw Wow got it!! Good find. So I wonder if it is the DebugKit box??
# Sep 20th, 15:57 admad @neon1024 that's been fixed in 4.0, param also defaults to null
# Sep 20th, 15:55 admad @luizcmarin unless you have enough experience with Cake I suggest you stick with stable release
# Sep 20th, 15:33 rochasmarcelo I tested with a new 'chrome user' profile and it worked
# Sep 20th, 15:33 rochasmarcelo It also could be some browser extension
# Sep 20th, 15:32 rochasmarcelo we could debug it more, it seems that google chrome is making additional requrest while typing the URL and posting
# Sep 20th, 15:15 luizcmarin Following the guidelines of https://book.cakephp.org/4.0/en/installation.html could not install or upgrade to cake 4. How to proceed?
# Sep 20th, 15:15 ron.rattie that's what she said
# Sep 20th, 15:08 henri.mjr i'm developing an escort site.. biggest project i've worked
# Sep 20th, 15:05 henri.mjr cleared cache and same thing.. i dunno what it was
# Sep 20th, 15:02 henri.mjr i've tried icognito and same thing
# Sep 20th, 15:01 ricksaccous @henri.mjr maybe browser caching?
# Sep 20th, 14:59 henri.mjr something with my chrome, worked fine in firefox
# Sep 20th, 14:46 henri.mjr witchcraft
# Sep 20th, 14:45 henri.mjr I don't get the missing controller message, apache gives me segmantation fault in the log, but only if the action name is the original: "add" if I rename it for anything else, it works. Strange that with the name "add" it worked until yesterday.
# Sep 20th, 14:43 daniel.upshaw Yay :slightly_smiling_face:
# Sep 20th, 14:43 neon1024 Then use starred items in the top right
# Sep 20th, 14:43 daniel.upshaw Perfect
# Sep 20th, 14:42 daniel.upshaw Thanks :slightly_smiling_face:
# Sep 20th, 14:42 neon1024 You could star the message
# Sep 20th, 14:40 henri.mjr Hello, I was working yesterday in an app and everything was OK, today I went back to work and I'm getting an empty response when I try to access a specific action, I renamed the action and it worked, but even accessing this action that no longer exists, I I get the empty response .. it looks like a cache, I've used cake cache clear_all but no luck .. What else can it be?
# Sep 20th, 14:39 neon1024 All I can think of
# Sep 20th, 14:39 neon1024 If it’s got an id it won’t be new
# Sep 20th, 14:39 neon1024 If the entity has no dirty fields it will not be saved, and thus skip all these bits
# Sep 20th, 14:37 jotpe status_id is a field of Table talks
# Sep 20th, 14:37 jotpe No it's Talkstable and I'm doing `if ($this->Talks->save($talk)) {`
# Sep 20th, 14:36 neon1024 Cake often kicks data off to the various tables, so if you’re in Posts but validating Tags, you should be in TagsTable
# Sep 20th, 14:35 jotpe yes
# Sep 20th, 14:35 neon1024 Are you in the right table?
# Sep 20th, 14:35 neon1024 Erm with a param
# Sep 20th, 14:35 jotpe hm. beforeRules isn't even triggered
# Sep 20th, 14:34 neon1024 Create a `protected function _setStatus () { return 1; }`
# Sep 20th, 14:34 neon1024 If you want to set a default, use a function in the entity
# Sep 20th, 14:33 jotpe o.O
# Sep 20th, 14:33 jotpe When I debug the entity in the controller, the status is not set
# Sep 20th, 14:32 daniel.upshaw We could reach out to them? I don't mind trying that myself and looping you in
# Sep 20th, 14:32 ricksaccous you're setting status
# Sep 20th, 14:32 luizcmarin =>composer require --update-with-dependencies "cakephp/cakephp:4.0.*" result = Installation failed, reverting ./composer.json to its original content.
# Sep 20th, 14:32 ricksaccous you aren't setting status_id in beforeRules
# Sep 20th, 14:31 jotpe it's a int
# Sep 20th, 14:31 daniel.upshaw It looks like dereuromark, markstory, and admad have done some stuff with SecurityComponent.php recently
# Sep 20th, 14:31 jotpe status_id
# Sep 20th, 14:31 ricksaccous or is status just a string
# Sep 20th, 14:31 ricksaccous @jotpe are you setting the status id or the status entity?
# Sep 20th, 14:30 jotpe is beforeRules not the right way?
# Sep 20th, 14:30 jotpe I want to set the status by default for new entities. Why does the validation fail?
# Sep 20th, 14:30 jotpe When I create a new Entity i get a validation error, saying the status is not set.
# Sep 20th, 14:29 slackebot <jotpe>
# Sep 20th, 14:27 neon1024 Why do params default to false and queries to null?
# Sep 20th, 14:27 neon1024 `public function getParam($name, $default = false)`
# Sep 20th, 14:27 neon1024 `public function getQuery($name = null, $default = null)`
# Sep 20th, 14:27 neon1024 Why is this?