Log message #4212583

# At Username Text
# Nov 6th 2019, 20:50 martonmiklosqdev and this is how I try to save it: ``` if ($this->request->is('post')) { $unitType = $this->UnitTypes->patchEntity( $unitType, $this->request->getData(), ['associated' => ['BaseUnits']] ); if ($this->UnitTypes->save($unitType, ['associated' => ['BaseUnits']])) {```
# Nov 6th 2019, 20:49 martonmiklosqdev this is how I setup the association in the UnitTypes
# Nov 6th 2019, 20:49 martonmiklosqdev ```$this->belongsTo('BaseUnits', [ 'foreignKey' => 'base_unit_id', 'className' => 'Units', ]);```
# Nov 6th 2019, 20:49 twelte Hey! Does somebody know a generic php-channel on freenode that I could get help at?
# Nov 6th 2019, 20:49 martonmiklosqdev I have UnitTypes which belongsTo an Unit
# Nov 6th 2019, 20:48 martonmiklosqdev I having some trouble saving a new entity to the database together with saving a belongsto associated data
# Nov 6th 2019, 20:47 martonmiklosqdev Hi folks,
# Nov 6th 2019, 20:41 ckjksl the file in your `src/Component` will "overwrite" the code one in `vendor` when Cake loads up
# Nov 6th 2019, 20:40 ckjksl @maymeow it's in the Auth component. `vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php`. But don't change it there. Copy that file to your `src/Component` folder and change it there
# Nov 6th 2019, 20:34 maymeow Hi I have on page `You are not authorized to access that location.` this flash when user wants to access page as not authorized... I need to translate it. How can i do this? i dont find string in default or code PO files
# Nov 6th 2019, 20:09 noel I've decided to do exactly as you suggest however, seems to work ok for me. Thanks for the feedback.
# Nov 6th 2019, 20:08 noel hmm.. dissent in the ranks.. @jotpe read up for what deuromark has to say about that! ;)
# Nov 6th 2019, 20:08 jotpe @noel I guess `buildRules()` is the place where you want to validate against your app data. `validationDefault()` checks, if the types of your requestData is right: https://book.cakephp.org/3/en/orm/validation.html#applying-application-rules
# Nov 6th 2019, 19:53 noel How can I add `isUnique` validation to `validationDefault`?
# Nov 6th 2019, 16:44 dereuromark @amanfulgence Please always use gist/pastebin and link it here, otherwise it spams the channel.
# Nov 6th 2019, 16:32 ricksaccous on the proper fields
# Nov 6th 2019, 16:32 ricksaccous if you are, with the proper controls, errors should show after POSTing
# Nov 6th 2019, 16:32 ricksaccous $this->Form->create
# Nov 6th 2019, 16:32 ricksaccous @amanfulgence are you using cake forms?
# Nov 6th 2019, 16:31 dereuromark @noel Usability is broken. try it. add validation rules and domain rules and have both fail, you would need two requests to find both, thats super bad. so for isUnique and others that should be valid user response always use one type only. In general: Domain rules usually should check other DB related integrity to avoid SQL exceptions. but uniqueness is data related.
# Nov 6th 2019, 16:30 karmicdice > So no Helpers or Anything involved Tried rendering the html to see if there isnt a glitch there?
# Nov 6th 2019, 16:28 noel @dereuromark what sort of problems did you get by using domain validators? (If you don't mind elaborating).
# Nov 6th 2019, 16:26 karmicdice @jotpe You are struggling with pdf since quite sometime now. I assume your use case is generating dynamic Pdfs, something on the fly with images and tables. Have you had a look at HTML to PDF? You will need gd and mbstring (which is also for cake). I would recommend you check spipu/html2pdf. Saved me and my client a lot of time. Works like a charm! But < 7.2
# Nov 6th 2019, 16:21 dereuromark Every one of my plugins
# Nov 6th 2019, 16:21 amanfulgence je voudrais afficher cette partie au clienst
# Nov 6th 2019, 16:20 slackebot1 'name' => true, 'password' => true, 'message' => true, 'tel' => true, 'adresse' => true, 'pays' => true, 'ville' => true, 'activite' => true, 'validate' => true ], '[original]' => [], '[virtual]' => [], '[hasErrors]' => true, '[errors]' => [ 'email' => [ 'unique' => 'The provided value is invalid' ] ], '[invalid]' => [ 'email' => 'f.aman@hypertech.ci' ], '[repository]' => 'Clients' }
# Nov 6th 2019, 16:20 slackebot1 [ 'country_id' => true, 'name' => true, 'password' => true, 'message' => true, 'tel' => true, 'adresse' => true, 'email' => true, 'pays' => true, 'ville' => true, 'activite' => true, 'validate' => true, 'last_send' => true, 'ok' => true, 'created' => true, 'modified' => true, 'country' => true, 'item_contacts' => true, 'item_reservations' => true, 'item_reviews' => true ], '[dirty]' => [ 'country_id' => true,
# Nov 6th 2019, 16:20 amanfulgence /src/Controller/Compte/ClientsController.php (line 208) object(App\Model\Entity\Client) { 'country_id' => (int) 1, 'name' => 'aman hanyrold', 'password' => '$2y$10$fdJl6Z09nLUPA4SBbQXje.qsBIBEF5LbPc7F2b/rBvx5nwd2gs9ne', 'message' => '', 'tel' => '+22541808018', 'adresse' => 'BP 287 abidjan 07', 'pays' => 'lagune', 'ville' => 'abidjan', 'activite' => 'informaticien', 'validate' => (int) 1, '[new]' => true, '[accessible]' =>
# Nov 6th 2019, 16:17 amanfulgence aide me please
# Nov 6th 2019, 16:16 amanfulgence i need to show this erros to my user
# Nov 6th 2019, 16:16 amanfulgence '[errors]' => [ 'email' => [ 'unique' => 'The provided value is invalid' ] ], '[invalid]' => [ 'email' => 'f.aman@hypertech.ci'
# Nov 6th 2019, 16:09 isvyas @dereuromark do you have any reference project that are using it? That would be great help.
# Nov 6th 2019, 16:07 isvyas No :slightly_smiling_face:
# Nov 6th 2019, 16:07 dereuromark or the advanced psr2r one which basically is the same + lots of useful things.
# Nov 6th 2019, 16:06 marek.sebera @isvyas like this? https://book.cakephp.org/2/en/contributing/cakephp-coding-conventions.html
# Nov 6th 2019, 16:06 dereuromark 1.x version
# Nov 6th 2019, 16:06 isvyas Is there Coding Standard rules specifically for Cakephp version 2?
# Nov 6th 2019, 16:06 marek.sebera ok, so the complicated, is it possible to run and interact with console/shells/tasks without having shell access at all?
# Nov 6th 2019, 16:04 dereuromark o_O
# Nov 6th 2019, 16:04 marek.sebera no, remote dev sincerelly
# Nov 6th 2019, 16:04 dereuromark we are talking about local dev here, right?