Logs for #cakephp

Page 5 of 36,478, showing 100 records out of 3,647,755 total, starting on record 401, ending on 500

# At Username Text
# Jan 23rd, 10:48 mark.mikkelson thanks
# Jan 23rd, 10:48 mark.mikkelson Oo
# Jan 23rd, 10:47 ndm may want to check my comment on SO
# Jan 23rd, 10:46 mark.mikkelson in 3.7
# Jan 23rd, 10:46 mark.mikkelson is there somewhere else the CSRF middleware could be being loaded from?
# Jan 23rd, 10:45 mark.mikkelson anybody able to shed some light on disabling CSRF, it's been driving me nuts for a day now. I've got no CSRF mentioned in my routes.php nor in the applicaiton.php , yet I still get Missing CSRF token cookie when posting data in?
# Jan 23rd, 10:44 val thanks
# Jan 23rd, 10:43 ndm @val I tend to forget to tag people
# Jan 23rd, 10:42 ndm `$joinTable = $PostsTable->Tags->junction()`
# Jan 23rd, 10:33 val I don't use 'through'
# Jan 23rd, 10:32 neon1024 I’d escalate it to @admad ;)
# Jan 23rd, 10:31 neon1024 You could rely on convention to find it perhaps :thinking_face:
# Jan 23rd, 10:31 neon1024 If you’re using the automatic join table, I’m not too sure, sorry
# Jan 23rd, 10:31 neon1024 As it should be the `through` option if you’re using that
# Jan 23rd, 10:31 neon1024 As it’ll return a class instance from the collection I reckon
# Jan 23rd, 10:30 neon1024 The association class returned in the collection should have that
# Jan 23rd, 10:30 val `$this->associations()` do not have join model. F.ex. Post HABTM Tag. What I need is to get posts_tags table and its alias.
# Jan 23rd, 10:30 neon1024 So perhaps you can filter by `belongsToMany`
# Jan 23rd, 10:30 neon1024 Although this is in the core `foreach ($table->associations()->type('BelongsTo') as $assoc) {`
# Jan 23rd, 10:29 conehead @dereuromark sweet. On holiday?
# Jan 23rd, 10:27 neon1024 I *think* it’s `foreach ($this->associations() as $association => $tableName)`
# Jan 23rd, 10:26 neon1024 I tend to loop the associations, using `$this->associations()`
# Jan 23rd, 10:25 val What is the proper way to get join model alias and table name in HABTM in 3.x?
# Jan 23rd, 10:19 dereuromark Releasing from hawaii^^
# Jan 23rd, 10:18 dereuromark I fixed it. 3.0 should now work
# Jan 23rd, 10:10 rudy1976s I am bit confused: so what version should I download with composer?
# Jan 23rd, 10:04 dereuromark Autsch.. i should have used my work app for releasing.
# Jan 23rd, 10:03 admad @dereuromark what he means is why is the new major 1.0 instead of 3.0, since the previous is 2.0
# Jan 23rd, 09:59 dereuromark Jep, and minimum stability beta, then it works. See sandbox cake4 branch etc
# Jan 23rd, 09:50 dereuromark What did i ... up?^^
# Jan 23rd, 09:02 gianmarxgagliardi morning ALL
# Jan 23rd, 08:59 challgren I’d probably use dev-cake4 until the version could be fixed to be 3.0.0-beta
# Jan 23rd, 08:58 challgren But that seems like a version issue that @dereuromark might need to fix since 2.7.1 is out that supports cake3.5+
# Jan 23rd, 08:57 rudy1976s @challgren thank you
# Jan 23rd, 08:57 challgren https://github.com/dereuromark/CakePHP-DatabaseLog/releases/tag/1.0.0-beta
# Jan 23rd, 08:57 challgren or dev-cake4
# Jan 23rd, 08:57 challgren @rudy1976s 1.0.0-beta
# Jan 23rd, 08:42 rudy1976s I am working for the first time with cake 4: I was trying to install dereuromark databaselog but I was unable to do it because of composer contraints: what is the correct version ?
# Jan 23rd, 08:41 rudy1976s morning all
# Jan 23rd, 04:31 turkles scratch that, I was doing the right thing it seems by ->get('role_id)
# Jan 23rd, 04:22 turkles If I've grabbed my user, contain roles, how do I add a role to that so I can save the user and it updates the users_roles list?
# Jan 23rd, 02:09 waspinator can you use the orm to look for rows filtered on values in a json field?
# Jan 23rd, 01:53 wizardfix 123:+1::skin-tone-3:
# Jan 23rd, 01:41 challgren @dereuromark to the transport?
# Jan 23rd, 01:39 dereuromark I found out the same. Could also have been a dto^^
# Jan 23rd, 00:25 luizcmarin @wizardfix https://api.cakephp.org/3.8/class-Cake.Validation.Validator.html#_sameAs ?
# Jan 22nd, 23:44 challgren So question with custom transports? I was under the understanding `Transport::send()`could return an array with anything in the array but in the CakePHP 4.0.2 code its typehinted with `@psalm-return array{headers: string, message: string}`
# Jan 22nd, 23:26 wizardfix @luizcmarin https://api.cakephp.org/3.7/class-Cake.Validation.Validator.html#_uploadedFile
# Jan 22nd, 23:24 wizardfix *Validation question: using Cake 3.8* I need to validate a User entity by comparing `password` and `confirm_password` fields and checking the password contains one of a list of non-alphanumeric characters. So I have been trying to find a `Cake\Validation\Validator` method that compares two fields, and a method that checks a string. I guess I need to write a custom validator for the latter, but I'm sure I found a method recently that
# Jan 22nd, 23:24 slackebot compares two fields but can't find it now. :) Looking at Stack Ovf etc. I find all sorts of ways of achieving this, many of which look pretty hacky. So I'm just looking for some advice on which way to go with this please... :thinking_face:
# Jan 22nd, 22:52 ndm It's a PHP thing, scalar values are integers, floats, booleans and string
# Jan 22nd, 22:51 luizcmarin @ndm 'scalar' cake === 'string' ?
# Jan 22nd, 22:49 ndm You are validating the `foto1` field as a scalar, which fails because the uploaded file object isn't a scalar value. I'm not familiar with that plugin, but it seems that it you have to care about handling the upload kinda yourself: https://github.com/josbeir/cakephp-filesystem#simple-upload-example Generally to avoid such problems with uploads, people usually use a separate field for the upload, one wich will have actual upload validation rules,
# Jan 22nd, 22:49 slackebot and then use application rules on the actual field, to validate the path where the file has been stored, at least that's for solutions where the path is being figured in the saving stage.
# Jan 22nd, 22:44 luizcmarin Perhaps some more information will help. I'm trying to use https://github.com/josbeir/cakephp-filesystem to make uoploads of images. But it's hard ...
# Jan 22nd, 22:39 luizcmarin does anyone know anything about this type of error?
# Jan 22nd, 22:13 luizcmarin I have a type => 'File' field for uploading an image. It is mysql, varchar (255). I am now getting the "Object of class Laminas \ Diactoros \ UploadedFile error could not be converted to string." What type should be used in the database? I installed the plugin https://github.com/josbeir/cakephp-filesystem.
# Jan 22nd, 20:24 challgren Install the suggestions if your going to use them such as storing them in a cloud provider
# Jan 22nd, 20:23 luizcmarin @challgren install suggests ?
# Jan 22nd, 20:21 luizcmarin I hope it is easy to use...
# Jan 22nd, 20:19 challgren `composer require josbeir/cakephp-filesystem`
# Jan 22nd, 20:19 challgren Yes release 2.0.1
# Jan 22nd, 20:18 luizcmarin https://github.com/josbeir/cakephp-filesystem :+1: I will follow here. Right?
# Jan 22nd, 20:17 luizcmarin :man-facepalming:
# Jan 22nd, 20:17 luizcmarin I didn't translate your message correctly ...
# Jan 22nd, 20:17 challgren Only the plugins with :strawberry: are cake 4 comp
# Jan 22nd, 20:16 challgren https://cakesf.slack.com/archives/C053DPNGT/p1579654134254800
# Jan 22nd, 20:15 luizcmarin @challgren
# Jan 22nd, 20:15 luizcmarin and there is only this 'master'
# Jan 22nd, 20:15 luizcmarin yea. I followed your link and got this
# Jan 22nd, 20:13 challgren The friendsofcake/awesome list has good plugins that are cake 4 ready
# Jan 22nd, 20:12 luizcmarin ops moment
# Jan 22nd, 20:12 challgren @luizcmarin why are you using a 3 plugin with cake 4?
# Jan 22nd, 20:10 luizcmarin I will change this to start
# Jan 22nd, 20:09 luizcmarin https://github.com/Xety/Cake3-Upload
# Jan 22nd, 20:09 ricksaccous are you using a plugin or writing file handling on your own?
# Jan 22nd, 20:09 ricksaccous make sure you can reference it
# Jan 22nd, 20:08 ricksaccous @luizcmarin generally you want to store the name of the file (maybe filesize/mimetype) and then move the file into a local directory
# Jan 22nd, 20:07 luizcmarin I'm trying to upload my first files. The fields are varchar (255) (mysql). It returns the image error. As I said, it is my first test and I do not know how to solve this type of error. Please, any guidance?
# Jan 22nd, 19:48 FredSavagely Oh, looks like you might be right: https://github.com/cakephp/authentication/blob/master/src/View/Helper/IdentityHelper.php
# Jan 22nd, 19:46 ndm Views have access to the request via `$this->request` too
# Jan 22nd, 19:43 ricksaccous you might as well do that, i think they had an identity helper
# Jan 22nd, 19:42 FredSavagely Like, assign the response of `$this->request->getAttribute('identity')` to the view?
# Jan 22nd, 19:42 FredSavagely Do I just need to assign the identity to the view and then use that to check?
# Jan 22nd, 19:41 ricksaccous they have that but if it doesn't have what you want then you should figure out a way to handle it on your own
# Jan 22nd, 19:41 ricksaccous https://book.cakephp.org/authorization/2/en/middleware.html#identity-decorator
# Jan 22nd, 19:40 ricksaccous oh, within the view...
# Jan 22nd, 19:40 ricksaccous https://github.com/cakephp/authorization
# Jan 22nd, 19:39 ricksaccous yeah, there's docs for the authorization plugin
# Jan 22nd, 19:37 FredSavagely Is there a resource somewhere that can show me how to use authorization within the view in CakePHP 4?
# Jan 22nd, 17:56 jslamka5685 I am already ordering the query. I will make sure I am not overlooking something
# Jan 22nd, 17:55 ricksaccous show what you're attempting if you want
# Jan 22nd, 17:55 ricksaccous or you can simply ->order() the query you are paginating
# Jan 22nd, 17:55 ricksaccous you can set it in the paginator settings via 'order'
# Jan 22nd, 17:54 jslamka5685 How can I grab the latest 20 sort ASC?
# Jan 22nd, 17:54 ricksaccous why not just sort by created ASC
# Jan 22nd, 17:53 jslamka5685 I planned to sort by created DESC then reverse the order so the conversation appears like what youd see in your SMS app on a phone
# Jan 22nd, 17:53 ricksaccous if you don't care about sorting by other means
# Jan 22nd, 17:53 ricksaccous also you can either use paginator links or simply order the query you are paginating
# Jan 22nd, 17:52 ricksaccous this doesn't explain why you have to reverse the item order