Log message #4198686

# At Username Text
# Aug 19th 2019, 13:31 davorminchorov it's thrown for fields like description, email address etc
# Aug 19th 2019, 13:31 dereuromark sounds like a cache issue then
# Aug 19th 2019, 13:30 davorminchorov I meant to say string fields
# Aug 19th 2019, 13:30 admad instead the fix obvious? don't set non numeric string values for integer fields :slightly_smiling_face:
# Aug 19th 2019, 13:28 davorminchorov This is the error I am getting due to that change in some forms: ``` 2019-08-16 14:02:49 Error: [InvalidArgumentException] Cannot convert value of type `string` to integer in /var/www/html/vendor/cakephp/cakephp/src/Database/Type/IntegerType.php on line 64 ```
# Aug 19th 2019, 13:26 davorminchorov Hi. The following behavior change started causing issues for string values during an upgrade: ``` Cake\Database\Type\IntegerType will now raise an exception when values are not numeric when preparing SQL statements and converting database results to PHP types. ``` Any ideas how can I fix this issue?
# Aug 19th 2019, 13:20 alexdd55976 as there is a mandatory use of the authorization middleware from 4.x ... is it me or is the documentation not well written... or say.. i could not find a simple use case like `if user is logged in let him use this action`
# Aug 19th 2019, 12:54 Nitrogen alright, that was it. default redirect logic was messing things up. I guess is('json') check should suffice to have produce json the way I need it.
# Aug 19th 2019, 12:48 Nitrogen okay, the 'index.ctp' is likely coming from default redirect code in edit actions. still doesn't explain why it wants a separate template from me.
# Aug 19th 2019, 12:45 ricksaccous show the controller action code as well as a debug of the view class from the controller action
# Aug 19th 2019, 12:45 Nitrogen as if it took note of the 'Referer', because I submit my request from index page.
# Aug 19th 2019, 12:44 Nitrogen actually, not sure why it is expecting index.ctp, while I submit to edit action. this looks off.
# Aug 19th 2019, 12:43 Nitrogen Proxies is the name of controller here.
# Aug 19th 2019, 12:42 Nitrogen edit actually goes through, since after updating the page I see my entity modified. but I get a 500 response about missing template: message Template file "Proxies/json/index.ctp" is missing.
# Aug 19th 2019, 12:41 Nitrogen it submits to unmodified freshly-baked edit action.
# Aug 19th 2019, 12:41 Nitrogen this is an action fired on link being clicked.
# Aug 19th 2019, 12:41 Nitrogen well, it's real simple tbf https://pastebin.com/HYnLcxrW
# Aug 19th 2019, 12:35 ricksaccous at this point just show code, lol, because we can only stab in the dark without seeing the LOC
# Aug 19th 2019, 12:34 Nitrogen and I'm setting the header specifically, yes. And it is reflected in my browser's network monitor.
# Aug 19th 2019, 12:33 Nitrogen I'm making the conclusion that it does, given it complains about lack of json-template for my action.
# Aug 19th 2019, 12:33 ricksaccous yeah you can either ask explicitly for json or set that header in the request
# Aug 19th 2019, 12:32 admad extension are optional but then the client needs to set proper `Accept` so that requesthandler knows it has to switch response type
# Aug 19th 2019, 12:32 royalty show me the link you're generating in html
# Aug 19th 2019, 12:31 royalty why would you disable them?
# Aug 19th 2019, 12:31 Nitrogen hm, looks like extension routes are optional. and disabling them didn't change the outcome. to answer the rest of your questions. I'm not setting view classes explicitly. And RequestHandler is loaded.
# Aug 19th 2019, 12:18 Nitrogen esp. since I wasn't asking for .json
# Aug 19th 2019, 12:17 Nitrogen ah, got abandoned route extension for json. this might be it.
# Aug 19th 2019, 12:17 ricksaccous are you asking for .json
# Aug 19th 2019, 12:16 ricksaccous are json extensions enabled in your routes
# Aug 19th 2019, 12:16 ricksaccous are you loading requesthandler component or whatever it is
# Aug 19th 2019, 12:16 ricksaccous are you setting a view class anywhere?
# Aug 19th 2019, 12:16 Nitrogen I'm on 3.5.10 btw
# Aug 19th 2019, 12:15 Nitrogen hey guys. cake is giving me trouble demanding json template, while documentation states _serialize is essentially the only thing I need to get rolling. any clues to what might be off?
# Aug 19th 2019, 12:09 ricksaccous and act accordingly
# Aug 19th 2019, 12:09 ricksaccous to see if they were passed or not
# Aug 19th 2019, 12:09 ricksaccous oh i suppose you do need the extra logic
# Aug 19th 2019, 12:09 ricksaccous i suppose, i don't really validate my params
# Aug 19th 2019, 12:08 k4t @ricksaccous with that approach there is important trade off - I have to validate params manually in the action instead of inside of route definition
# Aug 19th 2019, 12:02 unclezoot afternoon, is there a way to do streamed download using \Cake\Network\Http\Client? using it to get an oauth2 access token and would prefer not to use cURL for the download
# Aug 19th 2019, 11:55 ricksaccous one action/one route is fine
# Aug 19th 2019, 11:55 ricksaccous that's what i would do, just edit the query, etc, based on params