Log message #4212571

# At Username Text
# 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?
# Nov 6th 2019, 16:04 dereuromark there is simple and there is complicated :slightly_smiling_face:
# Nov 6th 2019, 16:04 marek.sebera that is usually disabled for standard webhosting
# Nov 6th 2019, 16:03 marek.sebera oh, but using exec()
# Nov 6th 2019, 16:03 dereuromark I shows all missing test classes in UI and you can click to generate the missing ones with simple mouse clicks for app or plugins: https://github.com/dereuromark/cakephp-test-helper - You can steal the code^^
# Nov 6th 2019, 16:03 dereuromark sure. I do that in my TestHelper plugin
# Nov 6th 2019, 16:03 marek.sebera Is it possible to use "bake" command/shell without shell access? like, for example, running it from controller?
# Nov 6th 2019, 16:02 dereuromark yeah, bad idea IMO
# Nov 6th 2019, 16:01 noel Oh ok thanks. The docs specifically say that unique should be domain validation – I wonder why that is?
# Nov 6th 2019, 16:00 dereuromark PS: I recommend first setting up normal validation rules, not domain rules. Especially also for Unique etc. Combined with other rules it would otherwise behave badly.
# Nov 6th 2019, 16:00 dereuromark check the docs here
# Nov 6th 2019, 16:00 dereuromark You might have to return the rules at the end?
# Nov 6th 2019, 15:57 slackebot1 Cake\ORM\Table->checkRules(Object(App\Model\Entity\Device), 'create', Object(ArrayObject)) #1 /Users/me/project/vendor/cakephp/cakephp/src/ORM/Table.php(1933): Cake\ORM\Table->_processSave(Object(App\Model\Entity\Device), Object(ArrayObject)) #2 /Users/me/project/vendor/cakephp/cakephp/src/ORM/Table.php(1638): Cake\ORM\Table->Cake\ORM\{closure}() ```