Logs for #cakephp

Page 3 of 36,130, showing 100 records out of 3,612,917 total, starting on record 201, ending on 300

# At Username Text
# May 21st, 14:42 birdy247 you planted the cookie seed
# May 21st, 14:42 birdy247 yes, what I said above
# May 21st, 14:42 birdy247 designing a solution
# May 21st, 14:41 neon1024 Not even like pencil and paper design
# May 21st, 14:41 neon1024 Have you literally tried nothing yet?
# May 21st, 14:41 neon1024 Send the cookie content to the endpoint and do it php
# May 21st, 14:41 neon1024 Don’t do that.
# May 21st, 14:41 neon1024 Are you going to ask how to de-hash in the widget?
# May 21st, 14:40 birdy247 thats fine
# May 21st, 14:40 birdy247 No, I understand how to do it on the server
# May 21st, 14:40 neon1024 Is that a serious question?
# May 21st, 14:40 neon1024 :man-shrugging:
# May 21st, 14:40 neon1024 I mean, like the one in the core
# May 21st, 14:40 neon1024 Using the hash method?
# May 21st, 14:39 birdy247 How would you has the cookie?
# May 21st, 14:37 neon1024 ..but cookies have expiration as well, so that’s up to you
# May 21st, 14:37 neon1024 You can include a datetime in the hash in the cookie too, so you know if it doesn’t match it’s expired
# May 21st, 14:37 neon1024 I tend to use a hash of data which I know, so that I can recreate the hash when I check the cookie
# May 21st, 14:36 neon1024 Just don’t obviously put the users password in the cookie
# May 21st, 14:36 neon1024 I mean, your implementation is your own
# May 21st, 14:36 neon1024 :man-shrugging:
# May 21st, 14:36 neon1024 You could pass the cookie content you’ve written to your server code
# May 21st, 14:34 birdy247 presumably the server could do its thing?
# May 21st, 14:34 birdy247 If we were to literally pass the contents of the cookie to the server
# May 21st, 14:34 neon1024 Turn on file sessions and have a look in /tmp
# May 21st, 14:34 birdy247 yea good point
# May 21st, 14:34 neon1024 Unless you do DB sessions or something perhaps and store extra data
# May 21st, 14:33 neon1024 Guessing a session is a great way to accidentally login the wrong user imgo
# May 21st, 14:33 neon1024 At least you know the cookie belongs to the user
# May 21st, 14:33 neon1024 How do you know which session is who’s?
# May 21st, 14:32 birdy247 If there is one, it returns a JWT token?
# May 21st, 14:32 birdy247 We just hit an endpoint which can read a session
# May 21st, 14:31 birdy247 @neon1024 how about a slightly different approach
# May 21st, 14:02 birdy247 maybe including a refresh token?
# May 21st, 14:01 birdy247 the widget then reads this cookie
# May 21st, 14:01 birdy247 Right, so when they login on our "cake" website, we create the cookie
# May 21st, 13:59 neon1024 I’d probably look into using a cookie, rather like a ‘remember me’ cookie, on the users machine that the widget can use to then hit an endpoint to confirm the details
# May 21st, 13:46 birdy247 and if someone logs in on the widget, they are logged in on the site.
# May 21st, 13:45 birdy247 So if someone is logged in on the site, they are logged in on the widget
# May 21st, 13:45 birdy247 We are trying to think up the best way to "share" the authentication between the widget and the website
# May 21st, 13:44 birdy247 but if someone is already logged in on our site, we dont want to ask them to login again in the widget
# May 21st, 13:44 birdy247 it uses JWT auth to authenticate people
# May 21st, 13:43 birdy247 In short, we have a statless "widget" that we have added to our page
# May 21st, 13:43 birdy247 Presumbly cake then handles fetching the session from the server when I do this->Auth->user() ?
# May 21st, 13:42 birdy247 When I login, I am created a session on the server?
# May 21st, 13:41 birdy247 Just trying to get my head around something
# May 21st, 12:30 hmic this setting is useless for php, mostly. as the php task will not keep any resource between requests (not not CLI or APACHE SAPI IMHO)
# May 21st, 11:57 paula to use persistent connection to the database I just need set 'persistent' => true in the database.php? I've already tried it but doesn't work the connection don't keep alive.
# May 21st, 10:23 welo.lamacchia on every table works fine but only for one table i received this error
# May 21st, 10:22 welo.lamacchia it's automatic
# May 21st, 10:22 welo.lamacchia i use with Cake Crud Listener
# May 21st, 10:20 neon1024 https://github.com/FriendsOfCake/search/tree/master/docs
# May 21st, 10:20 neon1024 It’s now `$this->request->getQueryParams()`
# May 21st, 10:20 neon1024 @welo.lamacchia Did you update your controller code?
# May 21st, 10:06 welo.lamacchia i use it with Crud plugin with Crud.Search listener
# May 21st, 10:06 welo.lamacchia i compared all my tables but no differences found
# May 21st, 10:05 welo.lamacchia after update FriendsOfCake Search plugin, in only one of my tables i saw this error: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Search\Model\Behavior\SearchBehavior' does not have a method 'searchParams' [CORE/src/ORM/BehaviorRegistry.php, line 253]
# May 21st, 10:00 neon1024 Silly, I can abstract the condition out to a class method :face_palm:
# May 21st, 09:48 neon1024 I’ve only managed the validation methods from the controller before
# May 21st, 09:47 neon1024 If you have more than one validation rule which relies on the same condition is that a good opportunity to add a new validation method, but where would you bind the condition ?
# May 21st, 09:36 dereuromark I have to also add that case into my CastTrait i just saw. Should gracefully return null.
# May 21st, 09:31 neon1024 Well spotted!
# May 21st, 09:31 dereuromark empty string is not null.
# May 21st, 09:31 neon1024 Although this does feel more like correct behaviour, and an incorrect assumption on my behalf
# May 21st, 09:30 slackebot <neon1024>
# May 21st, 09:29 neon1024 Seems there is a bug in Hash::get or it looks like it to me
# May 21st, 09:29 neon1024 My mistake, my test was wrong
# May 21st, 09:28 neon1024 Test-case passes, so it’s just my code. I wonder what I’ve done wrong
# May 21st, 09:23 neon1024 See if I can replicate it
# May 21st, 09:23 neon1024 I’m going to add a test-case
# May 21st, 09:21 dereuromark keep ?? or use my CastTrait. i use it for phpstan level 7 code.
# May 21st, 09:20 admad > If the posted value was missing, you’d expect `0` right? Yes I would
# May 21st, 09:08 neon1024 Which doesn’t feel right at all
# May 21st, 09:08 neon1024 `empty($this->getRequest()->getData('payment_charge_amount')) ? 0 : $this->getRequest()->getData('payment_charge_amount'),`
# May 21st, 09:08 neon1024 THen you end up with
# May 21st, 09:06 neon1024 Which leads to `$this->getRequest()->getData('payment_charge_amount') ?? 0` which defeats the point of the default value right?
# May 21st, 09:05 neon1024 :thinking_face:
# May 21st, 09:05 neon1024 `CallsController.php:203:null`
# May 21st, 09:05 neon1024 If the posted value was missing, you’d expect `0` right?
# May 21st, 09:05 neon1024 `$this->getRequest()->getData('payment_charge_amount', 0)`
# May 21st, 09:05 neon1024 So
# May 21st, 08:53 neon1024 Perhaps it’s a hasMany, and is generating an extra query, and the order has been moved to the other query
# May 21st, 08:14 willem what could be the reason this order by is removed from the resulting query? ``` ->contain( [ 'CompanyBookBalances.CompanyBooks' => function ($q) { return $q->order(['CompanyBooks.name' => 'ASC']); } ] ) ```
# May 21st, 07:50 welo.lamacchia is there a way to make work custom filter from My Own Plugin ?
# May 21st, 07:48 welo.lamacchia i found it, sorry!! :slightly_smiling_face:
# May 21st, 07:47 admad @welo.lamacchia you will have the answer to that if you read it's documentation
# May 21st, 07:44 welo.lamacchia hello, in FriendsOfCake Search is there a way to create custom Filter like value, boolean, compare etc ?
# May 21st, 07:40 k4t hello
# May 21st, 07:38 neon1024 Morning all :wave:
# May 21st, 07:08 admad @waspinator patching requires entity for the associations to be already present in entity you are patching
# May 21st, 02:38 waspinator it has a belongsToMany('Editors') and belongsToMany('Writers'), both of which are of `->setClassName('Users')`
# May 21st, 02:37 waspinator ``` object(App\Model\Entity\Group) { 'name' => 'test group', '[new]' => true, '[accessible]' => [ 'name' => true, 'editors_groups' => true, 'groups_writers' => true ], '[dirty]' => [ 'name' => true ], '[original]' => [], '[virtual]' => [], '[hasErrors]' => false, '[errors]' => [], '[invalid]' => [], '[repository]' => 'Groups' } ```
# May 21st, 02:15 turkles What does group look like if you dd() or log() ?
# May 20th, 22:31 waspinator that should work right?
# May 20th, 22:30 waspinator I'm trying to `patchEntity` with `belongsToMany` associated data, but it doesn't get added. ``` $group = $this->Groups->newEntity(); $data = [ 'name' => 'test group', 'editors' => [ '_ids' => [ (int) 0 => '1' ] ], 'writers' => [ '_ids' => [ (int) 0 => '2' ] ] ]; $group = $this->Groups->patchEntity($group, $data, [ 'associated' => ['Editors', 'Writers'] ]);
# May 20th, 22:30 slackebot $this->Groups->save($group); ```
# May 20th, 21:59 dereuromark there are tools that are supposed to find them as well out there
# May 20th, 21:59 dereuromark rightclick => usage can sometimes work in your IDE, otherwise code coverage or just delete and see what breaks
# May 20th, 21:56 swimboy Is there an easy way to identify classes that are no longer being used? I have a project that has had some significant restructuring and I think that there are a lot of classes that were only included for code that’s since been removed.
# May 20th, 19:46 michaelze I have three tables: - tours - users - profiles These have the following associations: ToursTable: $this->belongsTo('TourGuides', [ 'className' => 'Users', ]); // the foreignKey column is called tours.tour_guide_id UsersTable: $this->hasOne('Profiles'); ProfilesTable: $this->belongsTo('Users'); When I perform the following query: $this->Tours->query()->contain(['TourGuides', 'TourGuides.Profiles']) the following