Logs for #cakephp

Page 10 of 36,195, showing 100 records out of 3,619,426 total, starting on record 901, ending on 1,000

# At Username Text
# Jul 12th, 11:10 noel @igreat disabling CSRF as per those links doesn't seem to help. I assume that snippet is for the controller? (You said routes).
# Jul 12th, 11:10 igreat Guys I want to create an ACL in project using the Authorization and Authentication plugins, any headway on how to go about it?
# Jul 12th, 11:06 neon1024 As you know the expected outcome
# Jul 12th, 11:06 neon1024 I would probably start with TDD
# Jul 12th, 11:05 half2me anyway, maybe I’ll just try to write some simple logic
# Jul 12th, 11:05 half2me but I would need it to just cover basic hasOne and hasMany cases
# Jul 12th, 11:05 half2me I know with complex scenarios it can get out of hand
# Jul 12th, 11:05 half2me and it would take care of updating them
# Jul 12th, 11:05 neon1024 I didn’t bother in the end, it was too complicated
# Jul 12th, 11:04 half2me yeah, I was thinking of just a simple merger, where you could tell it what associations to look at
# Jul 12th, 11:04 neon1024 With nested recursive functions and all sorts
# Jul 12th, 11:04 half2me lol
# Jul 12th, 11:04 neon1024 Last time I tried to write an entity merger it got well out of hand
# Jul 12th, 11:04 neon1024 Ah well, that’s how I’d do it anyway
# Jul 12th, 11:04 neon1024 You could duplicate the existing one, which will perserve the keys, change the author id and you’re done
# Jul 12th, 11:04 half2me I want to merge 1 entity into another
# Jul 12th, 11:03 half2me but I don’t want to create anything new
# Jul 12th, 11:03 half2me for duplicating entities
# Jul 12th, 11:03 neon1024 You’re creating something new
# Jul 12th, 11:03 neon1024 No, I don’t think so
# Jul 12th, 11:03 half2me I’ve used this behavior before
# Jul 12th, 11:03 half2me @neon1024 isn’t this the exact opposite? :)
# Jul 12th, 11:03 neon1024 As the set option allows you to change the resulting entity
# Jul 12th, 11:03 half2me so merging Author 2 into Author 1 needs to update everyone’s `author_id` associated to Author 2.
# Jul 12th, 11:03 neon1024 https://github.com/riesenia/cakephp-duplicatable
# Jul 12th, 11:03 neon1024 Did you look at duplicatable?
# Jul 12th, 11:02 half2me and basically I would need a plugin which takes care of reassigning foreign keys of all their associations
# Jul 12th, 11:02 half2me I need to merge two similar entities
# Jul 12th, 11:01 half2me hey guys I’m wondering if you know of a plugin which can help me do this, or should I make my own solution
# Jul 12th, 10:57 neon1024 @noel Ahh okay!
# Jul 12th, 10:55 igreat @peppejaripappalardo Ok, why do want the `$organisations->actors['description']` ?
# Jul 12th, 10:51 igreat You have to disable the CSRF middleware for your API routes
# Jul 12th, 10:51 peppejaripappalardo thx for the reply @igreat and @challgren, i need to use the list because i using this query into a select box
# Jul 12th, 10:49 noel I'm trying to test my CakePHP REST API using Postman but I'm getting CSRF token missing errors. How can I get that working?
# Jul 12th, 10:48 noel Neon1024.. it's the sound Tintin makes when he punches people :slightly_smiling_face: (Proof Of Concept actually)
# Jul 12th, 10:46 igreat Hi @peppejaripappalardo first you are fetching list, use `find()` and the query will return the Actor Entity, hence you should get the description with `$organisations->description`
# Jul 12th, 10:44 challgren Don’t use `'list'` in your `find()`
# Jul 12th, 10:18 peppejaripappalardo Hi all, a little question: i have this query: $organisations = $this->Actors->find('list')->order(['Actors.description' => 'asc'])->matching('Organisations'); I need to get the property of organisations, but when i try to get the result with $organisations->actors['description'] cake say that is undefined property. Someone that can suggest to me how access inside the required property?
# Jul 12th, 10:08 neon1024 What’s a Poc?
# Jul 12th, 09:50 conehead And probably you need to load the `Poc` model in the `DevicesController`
# Jul 12th, 09:45 noel Oh... actually just realized why... I need to add `Devices` as a routing resource. Doh!
# Jul 12th, 09:44 slackebot $poc = $this->paginate($this->Poc); $poc = array('blah' => 'yaya'); $this->set(compact('poc')); $this->set('_serialize', ['poc']); } } ``` There's no difference as far as I can see, other than the second controller is linked to a DataTable, wheras the first is not. Here's the error: ``` Error: Devices.jsonController could not be found. ```
# Jul 12th, 09:44 noel Hi guys. I'm trying to get json output from controllers using the `RequestHandler` component. I've managed with one controller, but the other controller is giving me an error. Here's the controller that's working: ``` namespace App\Controller; use App\Controller\AppController; class PocController extends AppController { public function initialize() { $this->loadComponent('RequestHandler'); } public function index()
# Jul 12th, 09:44 slackebot { $poc = $this->paginate($this->Poc); $poc = array('blah' => 'yaya'); $this->set(compact('poc')); $this->set('_serialize', ['poc']); } } ``` Here's the one that's not: ``` namespace App\Controller; use App\Controller\AppController; class DevicesController extends AppController { public function initialize() { $this->loadComponent('RequestHandler'); } public function index() {
# Jul 12th, 09:36 jeremy.payne I'll have a look, thanks @neon1024 :slightly_smiling_face:
# Jul 12th, 09:35 neon1024 https://github.com/riesenia/cakephp-duplicatable
# Jul 12th, 09:34 neon1024 Use the duplicatable behaviour plugin
# Jul 12th, 09:34 jeremy.payne Also checked marshals but there aren't any that interract with the fields that I'm not seing.
# Jul 12th, 09:33 jeremy.payne What's the best way to duplicate a model? I tried `$copy = $articlesTable->newEntity($article->toArray())` but for some reason not all fields are being copied other. Looking at the `toArray()` result I see the fields I'm expecting, but when I `dd($copy)`, it's missing for example the `json_version` field :thinking_face: Would a better way be to just `$copy = clone($article); unset($copy->id);`?
# Jul 12th, 09:24 graziel i think i had same problem with update from 3.7 to 3.8
# Jul 12th, 09:23 neon1024 Heroic, thanks @graziel
# Jul 12th, 09:23 graziel you can also try removing sqlite file
# Jul 12th, 09:22 neon1024 Which makes this very confusing
# Jul 12th, 09:22 neon1024 `2019-07-12 09:16:33 Error: [Cake\Routing\Exception\MissingRouteException] A route matching "/debug-kit/toolbar/ee813904-758f-45e5-a70c-b591167e0b89" could not be found.`
# Jul 12th, 09:22 challgren RIP Toolbar :(
# Jul 12th, 09:21 neon1024 It’s Requests::view
# Jul 12th, 09:21 neon1024 Hah, now I see it :face_palm:
# Jul 12th, 09:21 slackebot <neon1024>
# Jul 12th, 09:21 neon1024 I’ve also lost the toolbar route entirely
# Jul 12th, 09:20 neon1024 Yeah, done that
# Jul 12th, 09:20 graziel try clear browser cache
# Jul 12th, 09:16 neon1024 My debug kit route is failing, and I can’t remember what I did to fix it last time
# Jul 12th, 08:40 neon1024 Or do I do a basic find, and switch on the resulting user data manually in the login method?
# Jul 12th, 08:39 neon1024 I feel like if I build it into the finder, then `Auth->identify()` will just fail, and not really tell me why
# Jul 12th, 08:39 neon1024 Is there an elegant way to feedback different login failure cases
# Jul 12th, 08:30 challgren Haha
# Jul 12th, 08:27 admad shouldn't you keep your sex life private?
# Jul 12th, 08:18 challgren Another night in Kotlin
# Jul 12th, 07:28 neon1024 Morning all :wave:
# Jul 11th, 22:13 ricksaccous and always specify the optional as 0 where necessary
# Jul 11th, 22:13 ricksaccous I'm just going to use 0 as my special string key
# Jul 11th, 22:12 ricksaccous how annoying
# Jul 11th, 22:12 ricksaccous actually in my "fix" it still is putting that portion of it as part of the GET request
# Jul 11th, 22:11 ricksaccous if you had optional args i suppose you could just specify them as null though or some weird string key if you had to
# Jul 11th, 22:10 ricksaccous so i did /edit/:company_id/:hospital_id/*
# Jul 11th, 22:10 ricksaccous so i have two args that i need for sure and one optional
# Jul 11th, 22:10 ricksaccous even if you do */* it does 3/3
# Jul 11th, 22:10 ricksaccous for some reason * instead of being allowed to do whatever, it's translating to argument 0
# Jul 11th, 22:09 ricksaccous yeah I got it working
# Jul 11th, 22:08 ricksaccous heh
# Jul 11th, 22:08 ricksaccous that matters
# Jul 11th, 22:07 ricksaccous yeah
# Jul 11th, 22:00 ricksaccous not sure if that matters
# Jul 11th, 22:00 slackebot <ricksaccous>
# Jul 11th, 21:59 challgren Ohh nm misunderstood
# Jul 11th, 21:59 ricksaccous i just want /3/20
# Jul 11th, 21:58 ricksaccous i don't want that though
# Jul 11th, 21:58 challgren You need an ‘id’ => $hospitalEntity->id
# Jul 11th, 21:57 slackebot <ricksaccous>
# Jul 11th, 21:55 ricksaccous the second param is being treated like a get param even though i'm not specifying it as one
# Jul 11th, 21:55 ricksaccous url
# Jul 11th, 21:55 ricksaccous when i'm building a rul
# Jul 11th, 20:14 ricksaccous i always just use $.ajax
# Jul 11th, 20:14 ricksaccous yeah i'm not too familiar with fetch
# Jul 11th, 20:14 yamcomnet body: JSON.stringify( { licenseType: 'license_type', quantity: 5 }),
# Jul 11th, 20:14 yamcomnet and fetch:
# Jul 11th, 20:14 yamcomnet thats how i read it
# Jul 11th, 20:14 yamcomnet $jsonData = $this->request->input('json_decode');
# Jul 11th, 20:13 yamcomnet almost crazy :)
# Jul 11th, 20:13 yamcomnet i got it