Logs for #cakephp

Page 1 of 34,882, showing 100 records out of 3,488,119 total, starting on record 1, ending on 100

# At Username Text
# Today, 01:52 Leonardo_0112 in the controller scope
# Today, 01:52 Leonardo_0112 $this->Banner->getEventManager()->dispatch(new CakeEvent('Model.afterDelete', $this->Banner)); did the trick ;)
# Today, 01:37 royalty good luck
# Today, 01:37 royalty I'm confused anyway I think I'm going to go get some exercise
# Today, 01:36 Leonardo_0112 royalty, I was using a component, but now I'm putting it on a bahavior
# Today, 01:36 Leonardo_0112 royalty, I'd like to do the same with Banners
# Today, 01:36 Leonardo_0112 royalty, because when I delete product or category, the behavior afterDelete clear all not used images
# Today, 01:35 royalty lol
# Today, 01:35 royalty if you want to do that but not actually afterDelete what's the point
# Today, 01:35 royalty and react to that event
# Today, 01:35 royalty instead you could create another event
# Today, 01:35 royalty why would you ever call it manually?
# Today, 01:34 Leonardo_0112 but seems like it is not working
# Today, 01:34 Leonardo_0112 I'd like to do is: $this->Banner->query('TRUNCATE TABLE banners;'); new CakeEvent('Model.afterDelete', $this);
# Today, 01:33 Leonardo_0112 In Cake 2 can I fire model afterDelete manually?
# Today, 01:25 royalty got it working but that was messy :(
# Today, 01:10 royalty I'll have to edit the widget
# Today, 01:10 royalty I think I know why, I'm simply spitting out the model message for the error instead of calling upon the custom error message I set
# Today, 01:09 royalty hmmmmm
# Today, 01:09 royalty I think what's happening is the options I have given are not being respected
# Today, 01:08 royalty however, the translated version is not showing
# Today, 01:07 royalty and I have errors set up in the field options like: https://gist.github.com/Modicrumb/a86f0efb53d5e03b1a648ea4c424fe0a
# Today, 01:02 royalty I am messing around with displaying errors for the field
# Today, 01:02 royalty so I am trying to build a form widget
# Today, 00:25 lpj145 somebody try use Crud with Cake 3.4 ?
# Today, 00:08 hiromi2424 My understand: set data to entity without patchEntity/newEntity will make entity have inconsistent data. validation and marshal is for set consistent data.
# Today, 00:06 hiromi2424 I don’t think not only for query formatting. It is for set correct data to entity.
# Today, 00:02 meder_ as opposed to more manual?
# Today, 00:01 meder_ like for related tables bound? so it's just an easy way to basically form a query to do an update?
# Yesterday, 23:59 hiromi2424 meder_ not only validation. association objects are initialized e.g. when _ids given
# Yesterday, 23:59 meder_ is patchEntity primarily just used for validation? if so, what's the point of sending validate: false (or equivalent) ?
# Yesterday, 23:54 hiromi2424 *date/datetime
# Yesterday, 23:54 hiromi2424 `setJsonEncodeFormat()` is part of DateFormatTrait
# Yesterday, 23:53 hiromi2424 By default JsonView automatically render data as json such convert data/datetime object to formatted string with cake Cake\I18n\DateFormatTrait
# Yesterday, 23:51 royalty if you are using js to display it you can either just modify it with php beforehand or try using moment.js or something
# Yesterday, 23:50 royalty so you aren't using php to display data?
# Yesterday, 23:50 hiromi2424 @keremcankaya I have experience with changing json date/datetime format: ``` \Cake\I18n\Date::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); \Cake\I18n\FrozenDate::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); \Cake\I18n\Time::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); \Cake\I18n\FrozenTime::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); ``` in `config/bootstrap.php`
# Yesterday, 23:43 keremcankaya Should i create a view and use the helper or just modify the result set?
# Yesterday, 23:43 keremcankaya I’m actually returning a json response from controller
# Yesterday, 23:39 dereuromark Use the TimeHelper
# Yesterday, 23:35 keremcankaya Is mapping the best way? Feels like there should be an option or an nicer way to format created
# Yesterday, 23:35 keremcankaya Finally I’ve started cake3 however I’m having hard time with returning created in a formatted way
# Yesterday, 23:04 royalty nevermind i got it
# Yesterday, 22:48 royalty how do i pass a value to a validation rule?
# Yesterday, 22:48 royalty hello
# Yesterday, 21:26 savant what action is failing when you redirect?
# Yesterday, 21:25 lucaskpo123 I did not do this login
# Yesterday, 21:25 lucaskpo123 I clarify that it is an old code
# Yesterday, 21:20 savant can you gist your controller?
# Yesterday, 21:20 lucaskpo123 yes,Did not work
# Yesterday, 21:19 savant lucaskpo123 did you try what lorenzo said to try?
# Yesterday, 21:18 lucaskpo123 can anybody help me
# Yesterday, 21:17 lucaskpo123 Hellw
# Yesterday, 21:01 lucaskpo123 alguno habla español para que me brinde sus conocimiento
# Yesterday, 21:01 lucaskpo123 Buenas señores
# Yesterday, 20:23 lucaskpo123 I have cakephp 1.2 and when doing a redirection the session is deleted
# Yesterday, 20:22 lorenzo @lucaskpo123 try calling session_write_close() before redirecting
# Yesterday, 20:22 lucaskpo123 Good, I need help with a serious theme of session by database
# Yesterday, 20:21 lucaskpo123 hello
# Yesterday, 20:21 chris-andre I was too busy with the model :P
# Yesterday, 20:21 lucaskpo123 I have problems with database session in cakephp 1.2 [5:19] When I do a redirect the session is deleted
# Yesterday, 20:20 lorenzo np :slightly_smiling_face:
# Yesterday, 20:20 chris-andre Typo. Thanks :slightly_smiling_face:
# Yesterday, 20:19 chris-andre Ah.
# Yesterday, 20:19 lorenzo it should be `$this->request->session()->id()`
# Yesterday, 20:19 lorenzo the problem is here `$this->request->sessions()->id()`
# Yesterday, 20:19 lorenzo ah ok, then it has nothing to do with using the model
# Yesterday, 20:18 chris-andre > Method sessions does not exist
# Yesterday, 20:17 lorenzo @chris-andre and what’s the error you’re getting?
# Yesterday, 20:11 chris-andre Last try was with TableRegistry, as you can see.
# Yesterday, 20:10 chris-andre @lorenzo Yes. Here is my controller action: https://gist.github.com/chris-andre/b22b1592702e5d3cc8081a3a74c7372c
# Yesterday, 19:36 lorenzo are you sure you are executing that in the context of a controller?
# Yesterday, 19:35 lorenzo `loadModel` is a method of all controllers
# Yesterday, 19:19 chris-andre Can't sessions table be loaded like other tables/models? I have tried `TableRegistry::get()` as well. Worked inside a component, but not in my controller. Any ideas?
# Yesterday, 19:18 chris-andre I'm trying to `$this->loadModel('Sessions')` in my controller, but I get > Method doesn't exists.
# Yesterday, 17:45 JD-Robbs tell Blurb
# Yesterday, 17:45 JD-Robbs ~tell Test
# Yesterday, 17:45 JD-Robbs test
# Yesterday, 16:45 chris-andre If so, I have to do some custom code to add the user_id to the sessions table. Will look into it later. GF is pushing me out of my chair. Thanks @hmic
# Yesterday, 16:41 chris-andre That is the table.
# Yesterday, 16:40 chris-andre https://book.cakephp.org/3.0/en/development/sessions.html#database-sessions
# Yesterday, 16:39 hmic you have the user_id in the sessiontable!
# Yesterday, 16:39 hmic no
# Yesterday, 16:39 chris-andre Yes, okay. Could do. Then I will have to look through every record until I have a match in Sessions.data
# Yesterday, 16:37 hmic you don't. you do have the user_id in the session table, just delete the entry/ies that match the user that got changed
# Yesterday, 16:37 chris-andre Right
# Yesterday, 16:36 hmic well, usually you need the user session data to be reevaluated if you change something like their permissions. at least that is the example case...
# Yesterday, 16:36 chris-andre Yes, but still I will need a join table to track the session
# Yesterday, 16:35 hmic just ~3 lines of code in an afterSave event of the user table and you are done
# Yesterday, 16:35 chris-andre Allright :slightly_smiling_face: Thanks. I doubt I can prove you wrong by now, so I guess I will go with deleting session.
# Yesterday, 16:35 hmic - event on save of userdata. you can unconditionally delete that data from the session table, if the user is not logged in, it does not matter anyways.
# Yesterday, 16:34 hmic if you think that is good practise too - just delete the session table entry with the user_id you have just changed
# Yesterday, 16:34 hmic i don't consider anything besides that good practise! you might come up with a case that proves me wrong though :d
# Yesterday, 16:33 chris-andre Okay. Should be okay.
# Yesterday, 16:33 hmic the simple - and usual - thing to do, if *important* data on a user changes is just logging that user out!
# Yesterday, 16:32 chris-andre Okay. Then we are on the same page. Can I ask, how should I update SessionsTable? By Auth->setUser()? Or is that considered wrong?
# Yesterday, 16:29 chris-andre Allright. I misunderstood you.
# Yesterday, 16:29 chris-andre Do you mean updating the user session (db) ?
# Yesterday, 16:29 hmic updating the session data is about updating the session data, not the user data!
# Yesterday, 16:28 chris-andre When I say updating user data, I mean updating data in the UsersTable