Logs for #cakephp

Page 1 of 36,290, showing 100 records out of 3,628,966 total, starting on record 1, ending on 100

# At Username Text
# Yesterday, 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?
# Yesterday, 21:49 rightscoreanalysis can i patch the entity before the rendering the form back to Admin?
# Yesterday, 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
# Yesterday, 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
# Yesterday, 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.
# Yesterday, 20:31 challgren Or straight up `fgetcsv()`
# Yesterday, 20:29 challgren @felipe.marinho you can use https://github.com/ProLoser/CakePHP-CSV
# Yesterday, 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.
# Yesterday, 20:28 challgren Plugin makes a good plugin!
# Yesterday, 20:19 dereuromark https://github.com/dereuromark/cakephp-queue is the most simple one and what we use for this
# Yesterday, 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.
# Yesterday, 20:12 felipe.marinho I need to relate, CSV columns with table columns, and that was the only way for me to solve this...
# Yesterday, 20:09 ndm Why would you even try to get that working? Processing 500k records is clearly a job for a background task.
# Yesterday, 20:06 jotpe Not sure about this :man-shrugging:
# Yesterday, 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?
# Yesterday, 19:59 jotpe To decouple the view a bit.
# Yesterday, 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?
# Yesterday, 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)
# Yesterday, 19:52 jotpe Maybe try catch and resolve the exception?
# Yesterday, 19:51 ricksaccous anyway i have a meeting, good luck
# Yesterday, 19:51 ricksaccous @felipe.marinho you're probably timing out, you want to chunk it out into jobs
# Yesterday, 19:51 jotpe :D
# Yesterday, 19:49 felipe.marinho It's an action that read a CSV with 500k lines and insert into the database lol
# Yesterday, 19:48 felipe.marinho This is my code: https://pastebin.com/ueqYpSG3
# Yesterday, 19:47 ricksaccous this might be more of a jquery/js question btw
# Yesterday, 19:47 ricksaccous where is the code you are using to execute the action?
# Yesterday, 19:47 ricksaccous how often are you executing the action?
# Yesterday, 19:46 ricksaccous how are you executing the action?
# Yesterday, 19:46 felipe.marinho Has anyone had a problem like this?
# Yesterday, 19:43 ricksaccous I've got enough juice for another hour and a half actually which is pretty much what I have to do
# Yesterday, 19:41 jotpe Oh damn :(
# Yesterday, 19:40 ricksaccous I'm feeling tired but unfortunately I have to chug a lug on for a while
# Yesterday, 19:40 ricksaccous it's not good working when you're tired
# Yesterday, 19:39 ricksaccous lol
# Yesterday, 19:39 jotpe I should go to bed...
# Yesterday, 19:39 jotpe Just stupid. My Query is against the Confirmation and not the Email itself
# Yesterday, 19:38 jotpe Ah wait
# Yesterday, 19:37 ricksaccous ok
# Yesterday, 19:37 jotpe The correct Entity
# Yesterday, 19:37 jotpe Well, it finds it.
# Yesterday, 19:36 ricksaccous are you sure the model is using that Entity?
# Yesterday, 19:36 slackebot <jotpe>
# Yesterday, 19:36 ricksaccous are you sure your naming is correct?
# Yesterday, 19:36 ricksaccous are you sure it's namespaced correctly?
# Yesterday, 19:36 jotpe Clearing the Cache didn't help. I remember I had the same problem and it was something with the Object.
# Yesterday, 19:35 ricksaccous if you do a find on the model without specifying select fields do you get "status" back?
# Yesterday, 19:35 ricksaccous did you clear your cache? did you recently add that column?
# Yesterday, 19:35 jotpe Yeah, i was testing. but the thing is....it didn't even get into that function
# Yesterday, 19:34 ricksaccous you should be able to do $entity->status = 'possible_enum'; without that
# Yesterday, 19:34 ricksaccous curious why you're even using that set... since it isn't mutating anything...
# Yesterday, 19:34 jotpe the field is an enum
# Yesterday, 19:34 jotpe also $_accessible
# Yesterday, 19:33 jotpe yes
# Yesterday, 19:33 ricksaccous do you have a status field in the schema?
# Yesterday, 19:33 jotpe I want to set the status of the mailaddress
# Yesterday, 19:33 jotpe https://book.cakephp.org/3.0/en/orm/entities.html#Cake\ORM\Entity::set
# Yesterday, 19:33 jotpe Yes.
# Yesterday, 19:32 ricksaccous getters are when you want to create new virtual fields based on existing properties
# Yesterday, 19:31 ricksaccous setters are for when you want to modify an existing property and spit that out
# Yesterday, 19:28 jotpe I know it was something with an Object/Enity, but can't remember. Anyone knows?
# Yesterday, 19:28 jotpe For some reason I got `Call to undefined method Users\Model\Entity\Emailaddress::status()`
# Yesterday, 19:27 slackebot <jotpe>
# Yesterday, 19:27 jotpe I've got a setter in my Entity for a field:
# Yesterday, 18:36 ricksaccous @maymeow i've never tried to do that but i found this https://github.com/naneau/php-obfuscator
# Yesterday, 18:30 maymeow i need advise. I have php application but i want protect some code from altering by users. Can be done something like this in php? (its problem because php apps is distributed as plain text not in compiled form)
# Yesterday, 18:08 henri.mjr I understand.. worked now, thanks
# Yesterday, 18:05 ricksaccous you can never do it the way you are attempting regardless since request data is immutable
# Yesterday, 17:59 henri.mjr argh.. token was not accessible!
# Yesterday, 17:56 henri.mjr uhmm
# Yesterday, 17:56 ricksaccous yes, $this->request/$this->getRequest() are immutable
# Yesterday, 17:55 admad @henri.mjr `$data = $this->request->getData()' unset($data['token'], $data['time_out']); $user = $this->Usuarios->patchEntity($user, $data);`
# Yesterday, 17:43 henri.mjr $user['token'] is filled :(
# Yesterday, 17:42 henri.mjr Hello! How it's the correct way to unset a field before patch? `$this->request->data['token'] = null;` ` $this->request->data['token_timeout'] = null;` ` $user = $this->Usuarios->patchEntity($user, $this->request->getData());`
# Yesterday, 17:36 jotpe Thanks for your help, @javier.villanueva
# Yesterday, 17:36 jotpe $confirmationsTable = TableRegistry::getTableLocator()->get('Users.EmailaddressConfirmations');
# Yesterday, 17:36 jotpe it's always the same. I run into the trap of not specifiying the plugin when getting the table...
# Yesterday, 17:35 jotpe DAMN.
# Yesterday, 17:20 javier.villanueva yes... if you dont want save two times, you can use a database trigger
# Yesterday, 17:20 jotpe Wait
# Yesterday, 17:20 jotpe So i have to set before
# Yesterday, 17:20 jotpe I guess that should break the foreign key constraint
# Yesterday, 17:20 javier.villanueva fuck return
# Yesterday, 17:19 javier.villanueva if ($confirmationTable->save($confirmation)) { $confirmation->emailaddress_id = $confirmation->id; }
# Yesterday, 17:18 javier.villanueva I dont know if is possible
# Yesterday, 17:17 javier.villanueva with a field or the same entity
# Yesterday, 17:17 javier.villanueva do you want to set this field always (auto)
# Yesterday, 17:17 javier.villanueva ok I understand now
# Yesterday, 17:16 jotpe 'emailaddress_id' => $entity->id
# Yesterday, 17:16 jotpe I set the entity_id when creating the newEntity
# Yesterday, 17:15 javier.villanueva it creates the protection entity with emailaddress_id to "null"?
# Yesterday, 17:15 jotpe yes
# Yesterday, 17:15 slackebot <jotpe>
# Yesterday, 17:15 javier.villanueva the new confirmation?
# Yesterday, 17:14 javier.villanueva and the entity is created?
# Yesterday, 17:14 javier.villanueva because this is the solution
# Yesterday, 17:14 jotpe I have
# Yesterday, 17:13 jotpe yes
# Yesterday, 17:13 javier.villanueva check if you has access to this field in Entity
# Yesterday, 17:07 jotpe Unfortunately setting the field in the constructor didn't worked
# Yesterday, 17:06 slackebot <jotpe>