Logs for #cakephp

Page 6 of 36,296, showing 100 records out of 3,629,532 total, starting on record 501, ending on 600

# At Username Text
# Sep 17th, 13:24 jotpe Second one produces: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
# Sep 17th, 13:23 jotpe Anyone has a clue on this issue?
# Sep 17th, 13:10 ra7bi GET is working but FIND not working
# Sep 17th, 13:09 ra7bi do i need to do anything more ?
# Sep 17th, 13:08 ra7bi only fetching data not able
# Sep 17th, 13:08 ra7bi but when i used ``` IndexRegistry::get('Users'); ``` i get nothing FYI im able to insert and edit and delete
# Sep 17th, 13:07 ra7bi hello , im trying to understand this point https://book.cakephp.org/elasticsearch/2.x/en/#searching-indexed-documents but i couldn't get result from elasticsearch i created ```model/document/user.php``` then i put ``` namespace App\Model\Document; use Cake\ElasticSearch\Document; class User extends Document { } ````
# Sep 17th, 12:51 henri.mjr It was what i'm looking for, valeu Felipão!
# Sep 17th, 12:50 henri.mjr I'll try
# Sep 17th, 12:40 felipe.marinho or even better: ```$usuario = $this->Acompanhantes->Usuarios->get($this->Auth->user('id'), ['contain' => ['grupos']]);```
# Sep 17th, 12:37 felipe.marinho ```$usuario = $this->Acompanhantes->Usuarios->get($this->Auth->user('id')); $grupo = $this->Acompanhantes->Usuarios->Grupos->get($usuario->grupo_id);```
# Sep 17th, 12:35 felipe.marinho Why don't you "get" the group too? the same as the User....
# Sep 17th, 12:33 henri.mjr The intention is get the Grupo.name of the user (grupo_id) when in AcompanhantesController (Usuarios belongs to Grupos, Acompanhantes belongs to Usuarios)..
# Sep 17th, 12:31 alexdd55976 at first look it seems fine thos
# Sep 17th, 12:30 henri.mjr Hello! This is working, but i feel i'm doing something wrong... `$usuario = $this->Acompanhantes->Usuarios->get($this->Auth->user('id'));` `$grupo = $this->Acompanhantes->Usuarios->Grupos->find('all',['conditions' => ['id'=>$usuario['grupo_id']]])->first();`
# Sep 17th, 11:14 jotpe thanks @conehead I ended up, with $user->setError() in the Controller
# Sep 17th, 11:09 conehead BeforeMarshal is used to convert form data to saveable entities. So this is not the right spot for you
# Sep 17th, 11:09 jotpe Yeah, it's not saving
# Sep 17th, 11:08 conehead If you are not saving it at all or it is not related to any Entity
# Sep 17th, 11:08 conehead For me it sounds more like you should validate it in your controller
# Sep 17th, 11:06 jotpe It's just in the request data
# Sep 17th, 11:06 jotpe Even if my Entity doesn't have the field set?
# Sep 17th, 11:06 alexdd55976 i think, you can validate at any point
# Sep 17th, 11:04 jotpe How can I validate a field, which is only present in the Form, but not in my Entity (e.g. comparing a `password` and a `password_repeat`? Or should I do this in beforeMarshal?
# Sep 17th, 10:49 challgren Ah ha it is `Cake\TestSuite\TestEmailTransport` wonder why this transport would be default when running in Integration Test mode
# Sep 17th, 10:47 jotpe ;9
# Sep 17th, 10:47 jotpe Got it `$this->Authentication->setIdentity($user);`
# Sep 17th, 10:44 jotpe Is there a way to set the Identity in the new Authentication plugin (e.g. After User Registration -> Log a user automatically in)?
# Sep 17th, 10:27 challgren Ok weird for some reason when running integration tests it seems like debug transport is loaded instead of the real transport
# Sep 17th, 10:25 challgren I think thats why]\
# Sep 17th, 10:25 challgren https://github.com/cakephp/cakephp/compare/3.8.2...3.8.4#diff-bf0a8fe5a8b62d4ca6be6deb2d9a4b35R42
# Sep 17th, 10:24 challgren Weird my tests are failing on 3.8.4 but work on 3.8.2
# Sep 17th, 10:24 jotpe thy
# Sep 17th, 10:24 jotpe @neon1024 yeah right, was a bit confused because I have that combined validation
# Sep 17th, 10:23 neon1024 https://github.com/cakephp/cakephp/blame/c50454fef169771cb28cb7589c9ead026f0c77f3/src/Mailer/Mailer.php#L312
# Sep 17th, 10:23 neon1024 @jadb Did 5 years ago
# Sep 17th, 10:22 challgren Grrr who changed the Mailer->send() return value!
# Sep 17th, 10:21 neon1024 @jotpe They should show up in the FormHelper output if the fields match up
# Sep 17th, 10:17 jotpe Is there some Helper or something to show Validation Errors?
# Sep 17th, 10:07 jotpe Thanks @javier.villanueva it worked :slightly_smiling_face:
# Sep 17th, 09:55 steinkel @neon1024 SecurityComponent
# Sep 17th, 09:48 jotpe I'll try
# Sep 17th, 09:48 jotpe ah okay
# Sep 17th, 09:48 jotpe yeah i thought it's the right place
# Sep 17th, 09:48 javier.villanueva $rules->add($rules->isUnique(['first_name', 'last_name']));
# Sep 17th, 09:48 javier.villanueva in buildRules you can try
# Sep 17th, 09:48 javier.villanueva ahm
# Sep 17th, 09:47 neon1024 `_Token was not found in request data` is this the CsrfMiddleware, CsrfComponent or SecurityComponent?
# Sep 17th, 09:47 jotpe I have a method to o this, but I want to validate when creating. So it shouldn't be possible to create a entity with this combination again
# Sep 17th, 09:46 javier.villanueva in entity
# Sep 17th, 09:46 javier.villanueva protected function _getNameDesc() { return $this->_properties['first_name'] . ' - ' . $this->_properties['last_name']; }
# Sep 17th, 09:45 javier.villanueva and.....
# Sep 17th, 09:45 javier.villanueva use in table $this->setDisplayField('name_desc');
# Sep 17th, 09:44 jotpe How can i validate a combination of fields (e.g. I don't want to have a combination of `first_name` and `last_name` in my Users Table.
# Sep 17th, 09:27 jotpe Hello folks
# Sep 17th, 09:10 challgren Hmm not sure
# Sep 17th, 09:01 johnwayne I am using Heroku (code is on Git) and its pretty small app with baisc out of box config (CakePhp Documentation)
# Sep 17th, 09:00 challgren You running anything like cloudflare or ngrok?
# Sep 17th, 08:59 johnwayne Morning to all, I have weird problem with Session timeout. Only one customer getting Error message from Auth `You are not authorized to access that location.` and I have increase Session timeout to 43200 and session.cookie_lifetime is to 86400. What can be the problem or how can I prevent this?
# Sep 17th, 08:39 challgren Haha, half the crap it doesn’t I dont even know what voodoo is behind the scenes
# Sep 17th, 08:38 dereuromark Make one :slightly_smiling_face:
# Sep 17th, 08:34 challgren I wish Cake had a tableau plugin
# Sep 17th, 07:50 neon1024 Hey everyone :sunrise:
# Sep 17th, 07:20 alexdd55976 morning
# Sep 17th, 06:53 javier.villanueva morning all
# Sep 17th, 05:25 maymeow thank you ill look at it
# Sep 16th, 22:23 rightscoreanalysis when I specify a custom url in my form I get the CSFR alert, how can I use a custom url and CSFR together?
# Sep 16th, 21:49 rightscoreanalysis can i patch the entity before the rendering the form back to Admin?
# Sep 16th, 21:48 rightscoreanalysis after the file is read I copy the contents into an array which I then want to render in a form, alllowing the admin to make an alterations before saving
# Sep 16th, 21:47 rightscoreanalysis I have a form with file upload field. This allows admin to import a text file which contains data to be saved to my Model
# Sep 16th, 20:32 dereuromark @felipe.marinho You gather the necessary data, and let it do the rest in the background. for this usually just the id of the db row is needed, the entity etc.
# Sep 16th, 20:31 challgren Or straight up `fgetcsv()`
# Sep 16th, 20:29 challgren @felipe.marinho you can use https://github.com/ProLoser/CakePHP-CSV
# Sep 16th, 20:29 felipe.marinho @dereuromark I'll definitely try it... just don't know how to relate the columns but, it's OK :slightly_smiling_face: thank you guys.
# Sep 16th, 20:28 challgren Plugin makes a good plugin!
# Sep 16th, 20:19 dereuromark https://github.com/dereuromark/cakephp-queue is the most simple one and what we use for this
# Sep 16th, 20:15 felipe.marinho I never created any code in PHP to run as a background task, just some exec commands... I'll try to restructure it.
# Sep 16th, 20:12 felipe.marinho I need to relate, CSV columns with table columns, and that was the only way for me to solve this...
# Sep 16th, 20:09 ndm Why would you even try to get that working? Processing 500k records is clearly a job for a background task.
# Sep 16th, 20:06 jotpe Not sure about this :man-shrugging:
# Sep 16th, 20:04 felipe.marinho But the problem is that PHP is blocking I/O when is processing data (monothread) the way we normally work, right?
# Sep 16th, 19:59 jotpe To decouple the view a bit.
# Sep 16th, 19:58 jotpe Maybe you could try something like build a view+json and after the file handling is finished, update the json to update the view?
# Sep 16th, 19:53 felipe.marinho But there's no error, or fail, the browser go "empty_response" but in the backend the action still executing, until the end (and complete with success)
# Sep 16th, 19:52 jotpe Maybe try catch and resolve the exception?
# Sep 16th, 19:51 ricksaccous anyway i have a meeting, good luck
# Sep 16th, 19:51 ricksaccous @felipe.marinho you're probably timing out, you want to chunk it out into jobs
# Sep 16th, 19:51 jotpe :D
# Sep 16th, 19:49 felipe.marinho It's an action that read a CSV with 500k lines and insert into the database lol
# Sep 16th, 19:48 felipe.marinho This is my code: https://pastebin.com/ueqYpSG3
# Sep 16th, 19:47 ricksaccous this might be more of a jquery/js question btw
# Sep 16th, 19:47 ricksaccous where is the code you are using to execute the action?
# Sep 16th, 19:47 ricksaccous how often are you executing the action?
# Sep 16th, 19:46 ricksaccous how are you executing the action?
# Sep 16th, 19:46 felipe.marinho Has anyone had a problem like this?
# Sep 16th, 19:43 ricksaccous I've got enough juice for another hour and a half actually which is pretty much what I have to do
# Sep 16th, 19:41 jotpe Oh damn :(
# Sep 16th, 19:40 ricksaccous I'm feeling tired but unfortunately I have to chug a lug on for a while
# Sep 16th, 19:40 ricksaccous it's not good working when you're tired
# Sep 16th, 19:39 ricksaccous lol