Log message #4032709

# At Username Text
# May 26th 2017, 10:45 obinoob I don't want to create a new object instance in every method, I'm sure there must be a way ;) a cakes way
# May 26th 2017, 10:42 obinoob also tried to implement lazy loading without success, so if there is somebody willing to help me on this new topic I would be very happy
# May 26th 2017, 10:41 obinoob Hi, after a lot of efforts I still don't know how to create an object instance on a trait, the object should be available in trait global scope so I could share it across multiple methods. I've tried a constructor function and initialise method as well none has worked
# May 26th 2017, 10:17 Neon1024 }
# May 26th 2017, 10:17 Neon1024 unset($this->request->data['hub']);
# May 26th 2017, 10:17 Neon1024 if (empty($this->request->getData('hub')) andand !empty($this->request->getData('hub_id'))) {
# May 26th 2017, 10:17 Neon1024 I’m here currently
# May 26th 2017, 10:17 Neon1024 But the key still exists in the post data then
# May 26th 2017, 10:17 Neon1024 $this->request = $this->request->withData(‘hub’, null);
# May 26th 2017, 10:16 Neon1024 All I can think is
# May 26th 2017, 10:16 Neon1024 Then the existing one would still be there, be caught by the validation and the save would fail
# May 26th 2017, 10:12 steinkel using the current spec, you could add another data key to match this condition, like 'hub_deleted'
# May 26th 2017, 10:10 hmic there has been quite some noise on that on the mailing list before i think...
# May 26th 2017, 10:10 hmic Neon1024, i'm on your side. i think they sould eighter remove methods to add data to the request or add methods to delete them too in the psr-7 spec
# May 26th 2017, 10:08 Neon1024 So in 4.0 you’ll not be able to remove keys and values from the request, unless a method is added
# May 26th 2017, 10:08 NeoTherm1c|Work hmic, I know that I need to check for breakage for 2.8 from 2.7, looking at the changes I might also need to double check how we see IP addresses and evaluate anything that might be using the Object
# May 26th 2017, 10:08 Neon1024 There is no method to match unset($ths->request->data[‘hub’])
# May 26th 2017, 10:08 Neon1024 So I have to check for the foreign key or new data, and adjust the request data
# May 26th 2017, 10:08 Neon1024 I can’t pass context to the association validation
# May 26th 2017, 10:07 Neon1024 With select existing or add new
# May 26th 2017, 10:07 Neon1024 My form has both parent and association
# May 26th 2017, 10:07 hmic steinkel: the idea comes from the possibility to add data to the request as per psr-7, but not beeing able to remove...
# May 26th 2017, 10:06 steinkel it's not part of http://www.php-fig.org/psr/psr-7/ why would you need to remove it?
# May 26th 2017, 10:05 hmic i'd go straight to lastest 2.9. so you only need to check for breakage once
# May 26th 2017, 10:04 NeoTherm1c|Work (I ponder more because 2.7.11's fix was also in 2.8.2, so... should I just go to 2.8.0 from 2.7.10?)
# May 26th 2017, 10:03 NeoTherm1c|Work somewhat simple update question, if I'm on 2.7.10, do I go 2.7.11, 2.8.0 -> 2.8.9 and then 2.9.x? (Assuming that I make each version jump manually to make sure there's no problems with our usage)
# May 26th 2017, 10:00 Neon1024 Guess i’ll just use the deprecated methods
# May 26th 2017, 09:58 Neon1024 So it’s not possible to remove a request data key and value?
# May 26th 2017, 09:57 Neon1024 Speaking of which I can’t find a method for removing request data, other than $this->request = $this->request->withData(), which still sets a value
# May 26th 2017, 09:53 Neon1024 Unless I’m missing it, it’s a pretty big var_dump()
# May 26th 2017, 09:53 Neon1024 I would think context would know how the validation had been called, either directly or as an association
# May 26th 2017, 09:52 Neon1024 Can I make validation conditional on associations based on the parent? Using a closure for the ‘when’ the $context doesn’t have any data from the parent, as the association is validated and merged separatly. So I’ll have to check and adjust the data in the controller before calling patchEntity right? Isn’t there a more elegant way to do this? How can I pass parent context to the associations validation?
# May 26th 2017, 09:35 Neon1024 This seems a conflict to me
# May 26th 2017, 09:35 Neon1024 Why is notEmpty($field, $message, $mode), but requirePresence($field, $mode, $message)
# May 26th 2017, 09:33 Neon1024 steinkel, I’ve actually never used the template extensions, should probably try that out at some point
# May 26th 2017, 09:32 Neon1024 More deps for rendering, but makes the code neater imo
# May 26th 2017, 09:32 Neon1024 https://github.com/davidyell/Cricketeer/blob/develop/webroot/mustache/batting.mustache
# May 26th 2017, 09:31 Neon1024 Exactly as I did in this project, https://github.com/davidyell/Cricketeer
# May 26th 2017, 09:31 Neon1024 So when I add a new hasMany association, I can render the template with JS to rename the fields correctly without having to put markup into my JS
# May 26th 2017, 09:30 Neon1024 So that I can render the template with both PHP and Javascript
# May 26th 2017, 09:30 Neon1024 I might refactor into something like Mustache templates