Logs for #cakephp

Page 9 of 36,389, showing 100 records out of 3,638,823 total, starting on record 801, ending on 900

# At Username Text
# Nov 6th, 20:49 twelte Hey! Does somebody know a generic php-channel on freenode that I could get help at?
# Nov 6th, 20:49 martonmiklosqdev I have UnitTypes which belongsTo an Unit
# Nov 6th, 20:48 martonmiklosqdev I having some trouble saving a new entity to the database together with saving a belongsto associated data
# Nov 6th, 20:47 martonmiklosqdev Hi folks,
# Nov 6th, 20:41 ckjksl the file in your `src/Component` will "overwrite" the code one in `vendor` when Cake loads up
# Nov 6th, 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, 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, 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, 20:08 noel hmm.. dissent in the ranks.. @jotpe read up for what deuromark has to say about that! ;)
# Nov 6th, 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, 19:53 noel How can I add `isUnique` validation to `validationDefault`?
# Nov 6th, 16:44 dereuromark @amanfulgence Please always use gist/pastebin and link it here, otherwise it spams the channel.
# Nov 6th, 16:32 ricksaccous on the proper fields
# Nov 6th, 16:32 ricksaccous if you are, with the proper controls, errors should show after POSTing
# Nov 6th, 16:32 ricksaccous $this->Form->create
# Nov 6th, 16:32 ricksaccous @amanfulgence are you using cake forms?
# Nov 6th, 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, 16:30 karmicdice > So no Helpers or Anything involved Tried rendering the html to see if there isnt a glitch there?
# Nov 6th, 16:28 noel @dereuromark what sort of problems did you get by using domain validators? (If you don't mind elaborating).
# Nov 6th, 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, 16:21 dereuromark Every one of my plugins
# Nov 6th, 16:21 amanfulgence je voudrais afficher cette partie au clienst
# Nov 6th, 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, 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, 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, 16:17 amanfulgence aide me please
# Nov 6th, 16:16 amanfulgence i need to show this erros to my user
# Nov 6th, 16:16 amanfulgence '[errors]' => [ 'email' => [ 'unique' => 'The provided value is invalid' ] ], '[invalid]' => [ 'email' => 'f.aman@hypertech.ci'
# Nov 6th, 16:09 isvyas @dereuromark do you have any reference project that are using it? That would be great help.
# Nov 6th, 16:07 isvyas No :slightly_smiling_face:
# Nov 6th, 16:07 dereuromark or the advanced psr2r one which basically is the same + lots of useful things.
# Nov 6th, 16:06 marek.sebera @isvyas like this? https://book.cakephp.org/2/en/contributing/cakephp-coding-conventions.html
# Nov 6th, 16:06 dereuromark 1.x version
# Nov 6th, 16:06 isvyas Is there Coding Standard rules specifically for Cakephp version 2?
# Nov 6th, 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, 16:04 dereuromark o_O
# Nov 6th, 16:04 marek.sebera no, remote dev sincerelly
# Nov 6th, 16:04 dereuromark we are talking about local dev here, right?
# Nov 6th, 16:04 marek.sebera that is usually disabled for standard webhosting
# Nov 6th, 16:04 dereuromark there is simple and there is complicated :slightly_smiling_face:
# Nov 6th, 16:03 marek.sebera oh, but using exec()
# Nov 6th, 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, 16:03 dereuromark sure. I do that in my TestHelper plugin
# Nov 6th, 16:03 marek.sebera Is it possible to use "bake" command/shell without shell access? like, for example, running it from controller?
# Nov 6th, 16:02 dereuromark yeah, bad idea IMO
# Nov 6th, 16:01 noel Oh ok thanks. The docs specifically say that unique should be domain validation – I wonder why that is?
# Nov 6th, 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, 16:00 dereuromark check the docs here
# Nov 6th, 16:00 dereuromark You might have to return the rules at the end?
# Nov 6th, 15:57 noel Hi all. I'm trying to get started with 3.x validation and have run straight into a wall. I'm able to save from Postman when there's no validation. When I try to add in isunique validation then it breaks. Here's the table: ``` <?php namespace App\Model\Table; use Cake\ORM\Query; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; use Cake\ORM\Rule\IsUnique; class DevicesTable extends Baked\DevicesTable { public
# Nov 6th, 15:57 slackebot1 function buildRules(RulesChecker $rules) { $rules->add($rules->isUnique( ['name'], 'This device is already registered.' )); } } ``` Here's the error: ``` 2019-11-06 15:47:28 Error: [Error] Call to a member function check() on null (/Users/me/project/vendor/cakephp/cakephp/src/Datasource/RulesAwareTrait.php:65) #0 /Users/me/project/vendor/cakephp/cakephp/src/ORM/Table.php(1994):
# Nov 6th, 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}() ```
# Nov 6th, 15:33 jotpe @amanfulgence https://startbootstrap.com/ has some good templates
# Nov 6th, 14:14 mario_ thanks
# Nov 6th, 14:07 dereuromark Follow the book/docs/tutorial and bake some code.
# Nov 6th, 14:02 mario_ How learn conventions cakephp?
# Nov 6th, 14:02 mario_ Hi
# Nov 6th, 13:55 ricksaccous pidlo, what are you trying to do?
# Nov 6th, 13:50 rochasmarcelo That's why auth plugins should be a minor issue in 9.next
# Nov 6th, 13:48 rochasmarcelo Well 9.next is for CakePHP 4 only
# Nov 6th, 13:45 rochasmarcelo You'll need to create a custom action for this.
# Nov 6th, 13:40 pidlo i would like search something about setDefaultConnection and i get nothing..
# Nov 6th, 13:38 admad http://google.com
# Nov 6th, 13:38 amanfulgence please give me link where i coul obtain
# Nov 6th, 13:37 admad you want link to google?
# Nov 6th, 13:37 amanfulgence please give me a link
# Nov 6th, 13:37 admad then ask google
# Nov 6th, 13:37 amanfulgence for hotel
# Nov 6th, 13:36 admad AdminLTE
# Nov 6th, 13:36 amanfulgence i need a well boostrap 4 template
# Nov 6th, 13:27 pidlo hello all in version 3 i use TableRegistry::get($m)->getConnection()->config()['name'] to get connection name which i set in model in static function setDefaultConnection now i get only Default..
# Nov 6th, 13:25 nayakvradhit In cakephp 2.1 even there is a file called geocoded php in the app/model/behavior folder inside which is having class Geocoded behavior extends ModelBehavior blah blah But when I migrate it to cakephp 2.10 I placed the same geocoded.php file into app/model/behavior folder but I am getting missing GeocodedBehavior class can you please help me with this why I am getting this in cakephp 2.10.13
# Nov 6th, 13:22 dereuromark but resend email with generated token and accepting action should be fairly simple to implement.
# Nov 6th, 13:22 dereuromark I dont have any public ones. and the sandbox doesnt provider register demo :slightly_smiling_face: sry
# Nov 6th, 13:19 rudy1976s @dereuromark could you please give me url of your app case ?
# Nov 6th, 13:13 nike90 Hi guys, I have a problem with require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';, I moved my system from a dev server to a live server, access is just with ip/cakephp, I copied also my .htaccess file from the dev server, any ideas?
# Nov 6th, 13:10 dereuromark I have re-send confirmation link feature here in my apps/cases. maybe you need to code that yourself or sth.
# Nov 6th, 13:09 rudy1976s because validation of the register fails
# Nov 6th, 13:09 rudy1976s I have user registrated which did not click registration confirmation link, and now the token has expired. Since the user is already in the table , set as active = 0 , the user is unable to register again
# Nov 6th, 13:08 rochasmarcelo @rudy1976s You can ask your question
# Nov 6th, 13:02 dereuromark aha ok
# Nov 6th, 12:56 val It looks like a dummy query is passed to `beforeFind` method instead of the main one. "For associations that use joins, a dummy query will be provided." - https://book.cakephp.org/3/en/orm/table-objects.html#beforefind So the mapper is not attached to the main query.
# Nov 6th, 12:52 dereuromark Thats why there is bool $primary param. If that is relevant to know, but for most behaviors it shold behave the same.
# Nov 6th, 12:51 dereuromark really? but then maybe there is some bug somewhere. as this is supposed to work from the model callback strategy.
# Nov 6th, 12:32 val That does not really work. F.ex. https://github.com/dereuromark/cakephp-tools/blob/master/src/Model/Behavior/BitmaskedBehavior.php - it works well when the model that uses Bitmasked is queried directly but if the associated model has Bitmasked then bitmasks are not converted to real values.
# Nov 6th, 12:14 rudy1976s I would need someone who is experienced with using of CakeDC Users plugin
# Nov 6th, 11:14 jotpe https://github.com/cakephp/app/blob/master/webroot/.htaccess
# Nov 6th, 11:14 jotpe https://github.com/cakephp/app/blob/master/.htaccess
# Nov 6th, 11:13 jotpe nike90: To which folder does your domain point to? `app/webroot`? Is the content of you` app/.htaccess` and your `app/webroot/.htaccess` like in the cakephp skeleton?
# Nov 6th, 11:10 jotpe @challgren No pdf generated, if I create from php o.O
# Nov 6th, 11:10 jotpe In fact I don't request the pdf (file download). I generate it for a email attachment like described over here: https://github.com/FriendsOfCake/CakePdf#2-create-pdf-for-email-attachment-file-storage-etc
# Nov 6th, 11:09 jotpe @javier.villanueva Thanks, I use a Theme for my FE and my BE, and tried remove it...but the same error.
# Nov 6th, 11:05 nike90 hi guys, I know that someone can help me, I moved my application from the develop server to the live system, now I have the problem with "require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';", I know that this is something with the .htaccess, but I set all files like in documentation
# Nov 6th, 10:59 challgren Does it generate a pdf? Have you tried opening it with text editor?
# Nov 6th, 10:59 javier.villanueva I dont know if you use any theme...
# Nov 6th, 10:59 javier.villanueva ´´´ if(!in_array($this->request->getParam('_ext'),['json','csv','pdf'])) { $this->viewBuilder()->setTheme('AdminLTE'); $this->viewBuilder()->setClassName('AdminLTE.AdminLTE'); } ´´´
# Nov 6th, 10:58 javier.villanueva I had this problem too, works from cli but not rendering html in layout. My problem was that I use a theme (admintle) in this cases I need use theme only in common extension
# Nov 6th, 10:56 challgren Weird
# Nov 6th, 10:56 jotpe So no Helpers or Anything involved
# Nov 6th, 10:56 jotpe This is really strange: I rendered the the view into a html file and converted this by cli with `wkhtmltopdf test.html test.pdf` <--- Works. If I use the rendered html file as layout with proper urls <---Breaks