Logs for #cakephp

Page 7 of 34,879, showing 100 records out of 3,487,833 total, starting on record 601, ending on 700

# At Username Text
# May 25th, 23:26 obinoob slackebot: jeremyharris you're a nice fellow :) thank you for your patience
# May 25th, 23:26 obinoob I will and the fact that I can't create an unique instance and pass my params drives me a bit crazy I'm self learning person so always looking to find proper answers only rest when I get my answer :)
# May 25th, 23:25 jeremyharris If you need it in the controller, make a getter that just caches the var on first call
# May 25th, 23:24 jeremyharris You don't need out anywhere else, so it's fine :)
# May 25th, 23:24 jeremyharris On the trait
# May 25th, 23:24 obinoob slackebot: yes I was doing that but that felt wrong
# May 25th, 23:23 jeremyharris Make it when you need it
# May 25th, 23:17 obinoob slackebot: not an easy task to me lol
# May 25th, 23:15 obinoob slackebot: where should I create UserData instance?
# May 25th, 23:12 obinoob slackebot: 2) remove AppRules constructor
# May 25th, 23:12 obinoob slackebot: 1) replace Controller constructor by public function initialize() { parent::initialize(); }
# May 25th, 23:10 jeremyharris Then make it a component :P
# May 25th, 23:10 jeremyharris So use initialize instead :) removing the constructor override will help. Then remove the trait constructor and just call a method that sets up the user instead. Problems solved
# May 25th, 23:08 obinoob slackebot: I'm afraid so
# May 25th, 23:08 jeremyharris You're currently overriding it with different parameters than the parent constructor expects, so things will definitely break
# May 25th, 23:07 jeremyharris Maybe forgot to call parent::initialize(). Either way you shouldn't override the constructor if you can help it
# May 25th, 23:06 obinoob slackebot: I jave tried but i raises some error that I don't recall right now...
# May 25th, 23:06 jeremyharris It's better to use initialize() instead.
# May 25th, 23:04 obinoob slackebot: The problem is the same to me I don't get how can i use a constructor in cakephp when it overrides Controller class or other... there are manny things that I'm not ware...
# May 25th, 23:02 jeremyharris But you should really refactor to either a component or lazy load the user when the trait methods need it
# May 25th, 23:01 jeremyharris Call $this->AppRulesConstruct() on the controller constructor
# May 25th, 23:00 obinoob slackebot: I totally agree so who can I solve this issue?
# May 25th, 23:00 jeremyharris That's why _user never gets set
# May 25th, 22:59 jeremyharris You aliased it but don't call that method name that I see
# May 25th, 22:59 jeremyharris The reason you're getting that error is because the trait constructor doesn't get called
# May 25th, 22:58 jeremyharris No the trait
# May 25th, 22:58 obinoob slackebot: You mean the UseData.php class?
# May 25th, 22:57 obinoob slackebot: in slackebot getUserId()
# May 25th, 22:57 jeremyharris Also this should probably be a component as it interacts with the controller layer (other components, the response)
# May 25th, 22:57 obinoob slackebot: https://postimg.org/image/vkktd1f6v/
# May 25th, 22:57 obinoob slackebot: someFunction was just an example
# May 25th, 22:56 jeremyharris Ok what's the problem? Where's "someFunction"
# May 25th, 22:54 obinoob slackebot: Controller: https://gist.github.com/fccpt/79d0c074d0592a88bd0cc7cb1d482f55
# May 25th, 22:54 obinoob slackebot: Trait: https://gist.github.com/fccpt/66962a7b6422ed933e30f04cdf03e00e
# May 25th, 22:53 obinoob slackebot: First Class https://gist.github.com/fccpt/fc2d887ebbbf2723842c68f831b507dd
# May 25th, 22:44 obinoob *yep I will never get used to this keyboard
# May 25th, 22:44 jeremyharris Seems like a fairly obvious error though. Wherever you're calling the function you're calling it on something that doesn't exist
# May 25th, 22:44 obinoob yesp i will
# May 25th, 22:43 jeremyharris obinoob gist your object (and its parents/traits) and the call
# May 25th, 22:43 obinoob I will try to gist a small example of the code
# May 25th, 22:42 jeremyharris meder_ make sure the controller is in the right namespace and that you have a route for the API prefix
# May 25th, 22:42 obinoob I have not a single idea on how to do this that is why I'm having a fatal error, what does it mean this: Call to a member function someFunction() on null
# May 25th, 22:41 jeremyharris Why not lazily construct it?
# May 25th, 22:39 obinoob anyone ?
# May 25th, 22:38 obinoob How can I do this?
# May 25th, 22:38 obinoob I need to create a new class instance on a trait that is being used on a Controller extended class I know that I can write a construtor on the trait and call it on the class that is being used but by default it will override the Controller construct
# May 25th, 22:21 obinoob Hi, I'm getting a fatal error, what does it mean this: Call to a member function someFunction() on null Error ?
# May 25th, 21:32 meder_ I made a controller in src/Controller/Api/AttachedImagesController.php but can't access it in /api/attached_images.. controller name is AttachedImagesController. what did I miss?
# May 25th, 21:29 inoas See you! around
# May 25th, 21:21 inoas the cache invalidation here sounds hard :(
# May 25th, 21:20 inoas Reverse routing (going from say Html::ink() to a url) with routes coming from the database should be cached, right?
# May 25th, 21:11 meder_ thanks!
# May 25th, 21:10 jeremyharris oh also the sql log in debug kit, might give you insight. anyway I have to go now, good luck!
# May 25th, 21:10 meder_ ok
# May 25th, 21:10 jeremyharris debug the entity after the failed save (the save result), it might tell you what you need to know.
# May 25th, 21:08 meder_ thank you
# May 25th, 21:08 meder_ yeah, really weird it doesn't. i'll keep messing around with it
# May 25th, 21:08 meder_ ok
# May 25th, 21:08 jeremyharris or rule failures
# May 25th, 21:07 jeremyharris meder_ that patchedentity should save now, assuming there’s no validation errors
# May 25th, 21:06 jeremyharris explicitly referencing it made it blank? that’s odd indeed
# May 25th, 21:06 jeremyharris ok so that should work then
# May 25th, 21:05 meder_ otherwise its like in that gist, populated
# May 25th, 21:05 meder_ actually, I played around with explicitly referencing 'Attachments' in 'associated', when i explicitly reference it, attachemnts is blank
# May 25th, 21:04 meder_ https://gist.github.com/anonymous/0c0856148d937d4ffcb2be9581cf8163 patched
# May 25th, 21:04 meder_ ok
# May 25th, 21:00 jeremyharris I’ll read through the cruft, don’t worry
# May 25th, 20:59 jeremyharris this line is how I know: https://gist.github.com/anonymous/670ef8a66a390bef35011306d7a22a5e#file-entities-php-L35
# May 25th, 20:59 jeremyharris looks like you modified the dump again :( please dump the full results of what we ask for, otherwise we end up taking 2 hours like this to solve an issue
# May 25th, 20:58 jeremyharris ok now the patched
# May 25th, 20:58 meder_ https://gist.github.com/anonymous/670ef8a66a390bef35011306d7a22a5e original entity with dirty/new
# May 25th, 20:55 meder_ alright
# May 25th, 20:55 meder_ k
# May 25th, 20:55 jeremyharris please gist the full results
# May 25th, 20:55 meder_ https://gist.github.com/anonymous/a94a69696962122805aa9224ba53cdc2
# May 25th, 20:55 jeremyharris (e.g., dirty props, isNew, etc)
# May 25th, 20:55 jeremyharris also, the gisted patchedEntity seems to be missing information
# May 25th, 20:54 jeremyharris may as well gist requestData too
# May 25th, 20:54 jeremyharris it will not be changed since you use a different variable for patchedEntity
# May 25th, 20:53 jeremyharris sure
# May 25th, 20:53 meder_ debug of the $entity after patch?
# May 25th, 20:52 jeremyharris you still haven’t given me the original entity
# May 25th, 20:51 meder_ ah ok
# May 25th, 20:51 jeremyharris the new entity test was just a test to see that it can create an entity from that table
# May 25th, 20:49 meder_ doesnt seem to do it
# May 25th, 20:49 meder_ let me dump patchedEntity sec
# May 25th, 20:49 meder_ ok, i removed the id and in the foreach im doing $newAttachment = $this->Attachments->newEntity($attachment); where $attachment is ['file_id' => 922, [new] => true]
# May 25th, 20:38 jeremyharris meder_ in the foreach one yeah
# May 25th, 20:36 meder_ slackebot: in that for loop?
# May 25th, 20:32 inoas See you! around
# May 25th, 20:32 inoas today is holiday in germany but well... I got deadlines ;)
# May 25th, 20:32 inoas hope you have a long weekend
# May 25th, 20:32 WyriHaximus Thanks, ttyl
# May 25th, 20:32 inoas enjoy
# May 25th, 20:32 WyriHaximus No problem :D! Anyway I got to run, long day ahead of me tomorrow. Will ping you during/over the weekend to see how your progress is going :)
# May 25th, 20:31 inoas I had the basic twig things going but that saved me a lot of time
# May 25th, 20:31 inoas thank you so much to get me started/fueld and not having to reinvent everything
# May 25th, 20:31 WyriHaximus inoas: yeah I know, but I don't have a lot of time for it now. Might be a month or two before I get to it. So glad to see you're figuring it out, and learning a lot in the process :)
# May 25th, 20:30 meder_ ok sec
# May 25th, 20:30 inoas then Twig can cache it as PHP