Log message #4033488

# At Username Text
# May 29th 2017, 16:01 hmic so this is why
# May 29th 2017, 16:00 thinkingmedia they are attached to the component.
# May 29th 2017, 16:00 thinkingmedia no, it's a child component of a component
# May 29th 2017, 16:00 hmic i have not used lazy loaded components. but they are attached to a controller, not another component, are they? :p
# May 29th 2017, 15:59 hmic it should be $this->getController()->RestError->couldNotSave() IMHO
# May 29th 2017, 15:59 thinkingmedia `$this->RestError->couldNotSave();` triggers lazy loading.
# May 29th 2017, 15:59 hmic where do you load it?
# May 29th 2017, 15:57 thinkingmedia https://gist.github.com/thinkingmedia/5a288e32b95dc78b54b26c9f170e7e07
# May 29th 2017, 15:56 hmic !tell thinkingmedia about gist
# May 29th 2017, 15:56 slackebot $config) { // this is never called parent::initialize($config); $con = $this->getController(); $this->eventManager($con->eventManager()); } public function couldNotSave() { return "stuff"; } } ```
# May 29th 2017, 15:56 thinkingmedia ``` class RestCreateComponent extends RestComponent { public $components = ['RestError']; public function initialize(array $config) { parent::initialize($config); $con = $this->getController(); $this->eventManager($con->eventManager()); } public function create() { return $this->RestError->couldNotSave(); } } class RestErrorComponent extends Component { public function initial
# May 29th 2017, 15:55 thinkingmedia k
# May 29th 2017, 15:54 hmic i want to see the code you use to lazy load it
# May 29th 2017, 15:54 thinkingmedia Unless that component was already loaded by the controller with loadComponent()
# May 29th 2017, 15:54 thinkingmedia well, if you set $component property to lazy load another component. That other component will not get initialized or startup invoked at all.
# May 29th 2017, 15:51 hmic can you show code?
# May 29th 2017, 15:50 thinkingmedia If a component lazy loads a child component the "startup" is not fired. Is this correct behavior?
# May 29th 2017, 15:11 spriz I actually had deployed with my fork, but then reverted since I didn't know if it had unknown consequences :)
# May 29th 2017, 15:11 spriz Yeah as long as I didn't know if it was intended :) It might introduce a ton of unwanted (untested) changes :P
# May 29th 2017, 15:11 hmic you might want to learn some composer magic instead ;-)
# May 29th 2017, 15:10 hmic instead of using your fixed fork of the Crud plugin till the fix is accepted? wow!
# May 29th 2017, 15:09 spriz I'll let it be for now then, just added 1k lines for empty functions to our code base anyway :,)
# May 29th 2017, 15:09 hmic i still think your PR is correct though!
# May 29th 2017, 15:08 spriz but that doens't make it right
# May 29th 2017, 15:08 spriz it worked without issues for years :P
# May 29th 2017, 15:08 spriz aye
# May 29th 2017, 15:07 hmic call it whatever, it needed to be there before, didn't it? without calling crud->execute() crud would not do anything in your controller actions
# May 29th 2017, 15:07 spriz It doesn't do anything and serve(d) no purpose prior to 3.3 (including in 2.x)
# May 29th 2017, 15:06 spriz at least line 33 -> 56
# May 29th 2017, 15:06 spriz I'd call this boilerplate: https://gist.github.com/Spriz/30cd4559f5671e5b20d4706a550320d8 :P
# May 29th 2017, 15:06 hmic probably thats why nobody hit the issue before, since 3.3 is out for quite some time already...
# May 29th 2017, 15:05 hmic spritz: that's not boilerplate. thats what *any crud mapped action* needs to do! call Crud->execute()!
# May 29th 2017, 15:05 hmic still, you are correct with your suggested pr, following the (not so) recent changes in the cakephp request cycle regarding the authcomponent
# May 29th 2017, 15:04 spriz okay @hmic :slightly_smiling_face: that's fair enough - we'll just add this boilerplate all over :)
# May 29th 2017, 15:04 hmic if it does not - thats a problem on it's own!
# May 29th 2017, 15:03 hmic *any* crud mapped action is to call Crud->execute()!
# May 29th 2017, 15:03 admad cya'll
# May 29th 2017, 15:03 hmic spritz: i don't consider this a problem
# May 29th 2017, 15:02 admad i avoid commenting when i can't really help, unless it's my personal repo
# May 29th 2017, 15:01 spriz just wanted to hear if it was "do'h, don't want to answer that" or "Don't have time for assisting with the test" :muscle:
# May 29th 2017, 15:01 spriz @admad aye, it's https://github.com/FriendsOfCake/crud/pull/534 :slightly_smiling_face: And fair enough :muscle: