Log message #4096593

# At Username Text
# Nov 14th 2017, 10:45 diego182 3.5 is the way to go IMHO take advantage of PSR7, and start prep the app for CakePHP 4 with all deprecated methods
# Nov 14th 2017, 10:44 neon1024 Yummy PSR7
# Nov 14th 2017, 10:43 neon1024 Or upgrade to 3.5! :)
# Nov 14th 2017, 10:43 obinoob diego182 that might be the right method :)
# Nov 14th 2017, 10:42 obinoob neon1024 I can see var_dump($this->request); data and the query is there oubviously ;) also var_dump(get_class($this->request)); returns the name of the class as expected...
# Nov 14th 2017, 10:42 neon1024 Pre 3.4, good catch :slightly_smiling_face:
# Nov 14th 2017, 10:42 neon1024 Yes! @diego182
# Nov 14th 2017, 10:42 diego182 @obiboob on cakephp 3.1 you have to use `$this->request->query()`
# Nov 14th 2017, 10:39 neon1024 Well I’m out of ideas then. Sounds to me like you have some debugging to do!
# Nov 14th 2017, 10:39 obinoob neon1024 no I'm in 3.1 :(
# Nov 14th 2017, 10:39 neon1024 Even though it’s still `$this->request` even in Cake 2, https://github.com/cakephp/cakephp/blob/2.x/lib/Cake/View/View.php#L195-L202
# Nov 14th 2017, 10:38 neon1024 Leading Cake to think you’re looking for a component?
# Nov 14th 2017, 10:38 neon1024 Perhaps you used a capital R in `request`
# Nov 14th 2017, 10:38 neon1024 `var_dump(get_class($this->request))`
# Nov 14th 2017, 10:37 neon1024 Or you’re in Cake 2 perhaps
# Nov 14th 2017, 10:37 neon1024 If the method does not exist then $this->request isn’t an instance of the request and you have bigger problems
# Nov 14th 2017, 10:37 neon1024 Here you are, https://github.com/cakephp/cakephp/blob/master/src/Http/ServerRequest.php#L1434-L1458
# Nov 14th 2017, 10:36 neon1024 Want me to look that one up for you?
# Nov 14th 2017, 10:36 neon1024 Well pick the right method ;)
# Nov 14th 2017, 10:35 obinoob neon1024 Error: [BadMethodCallException] Method getQuery does not exist
# Nov 14th 2017, 10:34 obinoob perhaps I better set or compact from controller ...
# Nov 14th 2017, 10:34 neon1024 Then you have a bug elsewhere in your code. Check your logs
# Nov 14th 2017, 10:34 obinoob neon1024 well I've tested that and I get a 500 status code :/
# Nov 14th 2017, 10:33 neon1024 Where $this is a View instance, which has the request -> https://github.com/cakephp/cakephp/blob/master/src/View/View.php#L202-L209
# Nov 14th 2017, 10:33 neon1024 obinoob, Yes. It’s just `$this->request->getQuery()`
# Nov 14th 2017, 10:32 neon1024 https://book.cakephp.org/3.0/en/orm/query-builder.html#advanced-conditions
# Nov 14th 2017, 10:32 obinoob Hi, Is there any way I can access the all url query string from a view without using $_SERVER['QUERY_STRING'] in worst case? Or filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_SANITIZE_SPECIAL_CHARS)? I've read this page but didn't have found any method that actually works... https://book.cakephp.org/3.0/en/controllers/request-response.html#query-string-parameters
# Nov 14th 2017, 10:32 neon1024 I don’t use the `gte()` functions, but you could use those if you wanted I suppose
# Nov 14th 2017, 10:31 neon1024 If you need help with an `if()` statement ;P
# Nov 14th 2017, 10:31 neon1024 Just as you said you would.
# Nov 14th 2017, 10:29 willem and how would i do this in CakePHP 3 ?
# Nov 14th 2017, 10:20 neon1024 Yes
# Nov 14th 2017, 10:12 willem is that possible?
# Nov 14th 2017, 10:11 willem what would be the best way to create a find for a date between start_date and end_date; where end_date should only be used if not null. So ` if (end_date is not null) then today between start_date and end_date else today >= start_date `
# Nov 14th 2017, 09:55 meowcate Same here
# Nov 14th 2017, 09:42 neon1024 Morning everyone! :slightly_smiling_face:
# Nov 14th 2017, 08:55 admad gtg
# Nov 14th 2017, 08:55 admad instead of relying on security token, use 'fieldList' https://book.cakephp.org/3.0/en/orm/saving-data.html#avoiding-property-mass-assignment-attacks
# Nov 14th 2017, 08:52 admad a solution even if achievable would be too complicated and not worth the maintenance effort
# Nov 14th 2017, 08:51 sniedermaier ok, so i take a workaround and submit to a different url via ajax and use the action for the preview ... but would be nice, if we could get this as an improvement to FormHelper/SecurityComponent
# Nov 14th 2017, 08:49 admad the security token includes the URL to submit to, so it's not possible to generate a token which can be valid for more than one action url