Logs for #cakephp

Page 5 of 36,247, showing 100 records out of 3,624,625 total, starting on record 401, ending on 500

# At Username Text
# Aug 19th, 13:36 admad check if you model class has _initializeSchema() method
# Aug 19th, 13:35 davorminchorov It's being cast to int but not sure how and why: ``` #2 /var/www/html/vendor/cakephp/cakephp/src/Database/Statement/PDOStatement.php(69): Cake\Database\Statement\StatementDecorator->cast('Some Info about...', Object(Cake\Database\Type\IntegerType)) ```
# Aug 19th, 13:34 admad go further
# Aug 19th, 13:34 davorminchorov This looks like the issue ``` #3 /var/www/html/vendor/cakephp/cakephp/src/Database/ValueBinder.php(147): Cake\Database\Statement\PDOStatement->bindValue('c7', 'Some Info about...', 'integer') ```
# Aug 19th, 13:32 admad follow the stack trace
# Aug 19th, 13:32 davorminchorov I have no idea, new to the framework. Where can I check that?
# Aug 19th, 13:31 admad why would those fields use `IntegerType`?
# Aug 19th, 13:31 dereuromark if you change the field(type), make sure to clear cache
# Aug 19th, 13:31 davorminchorov it's thrown for fields like description, email address etc
# Aug 19th, 13:31 dereuromark sounds like a cache issue then
# Aug 19th, 13:30 davorminchorov I meant to say string fields
# Aug 19th, 13:30 admad instead the fix obvious? don't set non numeric string values for integer fields :slightly_smiling_face:
# Aug 19th, 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, 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, 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, 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, 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, 12:45 ricksaccous show the controller action code as well as a debug of the view class from the controller action
# Aug 19th, 12:45 Nitrogen as if it took note of the 'Referer', because I submit my request from index page.
# Aug 19th, 12:44 Nitrogen actually, not sure why it is expecting index.ctp, while I submit to edit action. this looks off.
# Aug 19th, 12:43 Nitrogen Proxies is the name of controller here.
# Aug 19th, 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, 12:41 Nitrogen it submits to unmodified freshly-baked edit action.
# Aug 19th, 12:41 Nitrogen this is an action fired on link being clicked.
# Aug 19th, 12:41 Nitrogen well, it's real simple tbf https://pastebin.com/HYnLcxrW
# Aug 19th, 12:35 ricksaccous at this point just show code, lol, because we can only stab in the dark without seeing the LOC
# Aug 19th, 12:34 Nitrogen and I'm setting the header specifically, yes. And it is reflected in my browser's network monitor.
# Aug 19th, 12:33 Nitrogen I'm making the conclusion that it does, given it complains about lack of json-template for my action.
# Aug 19th, 12:33 ricksaccous yeah you can either ask explicitly for json or set that header in the request
# Aug 19th, 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, 12:32 royalty show me the link you're generating in html
# Aug 19th, 12:31 royalty why would you disable them?
# Aug 19th, 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, 12:18 Nitrogen esp. since I wasn't asking for .json
# Aug 19th, 12:17 Nitrogen ah, got abandoned route extension for json. this might be it.
# Aug 19th, 12:17 ricksaccous are you asking for .json
# Aug 19th, 12:16 ricksaccous are json extensions enabled in your routes
# Aug 19th, 12:16 ricksaccous are you loading requesthandler component or whatever it is
# Aug 19th, 12:16 ricksaccous are you setting a view class anywhere?
# Aug 19th, 12:16 Nitrogen I'm on 3.5.10 btw
# Aug 19th, 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, 12:09 ricksaccous and act accordingly
# Aug 19th, 12:09 ricksaccous to see if they were passed or not
# Aug 19th, 12:09 ricksaccous oh i suppose you do need the extra logic
# Aug 19th, 12:09 ricksaccous i suppose, i don't really validate my params
# Aug 19th, 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, 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, 11:55 ricksaccous one action/one route is fine
# Aug 19th, 11:55 ricksaccous that's what i would do, just edit the query, etc, based on params
# Aug 19th, 11:54 k4t maybe I should declare only one action and one route to that action with wildcard for params?
# Aug 19th, 11:53 k4t https://gist.github.com/K4T/3d88fbb23733ad935f60e46d77aa004c how would you simply such duplicated actions code?
# Aug 19th, 11:53 k4t may I ask you for an advice?
# Aug 19th, 11:53 k4t Hi all
# Aug 19th, 11:38 admad but iirc the trait still uses/needs the component
# Aug 19th, 11:37 admad yes
# Aug 19th, 11:30 neon1024 How is it that I’ve unloaded the CrudComponent but it still works? Is that the trait doing that?
# Aug 19th, 11:12 admad @conehead hasOne would generate joins so it would be essentially same and manual joins
# Aug 19th, 11:11 admad Hehe
# Aug 19th, 11:11 neon1024 Haha, well for all we know you might be called Mark @admad
# Aug 19th, 11:10 slackebot Action: admad ehm
# Aug 19th, 11:07 neon1024 It’s like the lead developers made up the rule :P
# Aug 19th, 11:06 neon1024 As you can’t get onto the Cake core team unless you’re named Mark or José
# Aug 19th, 11:06 neon1024 Well, one of the José’s
# Aug 19th, 11:06 neon1024 The only person who might be able to actually answer would be José
# Aug 19th, 11:04 conehead I will give it a shot tomorrow...and will let you know ;)
# Aug 19th, 11:04 neon1024 Such as the indexes we touched on a moment ago
# Aug 19th, 11:04 neon1024 If you’re getting into these kinds of optimisations, then they are incredibly environment specific
# Aug 19th, 11:03 neon1024 @conehead Because every application and environment is different
# Aug 19th, 11:03 neon1024 Sorry, I just found it `$this->modelClass = false;`
# Aug 19th, 11:02 conehead Just wanted to double check ;) Asking someone is simple as well...if someone knows, why test it in the first line :P
# Aug 19th, 11:02 neon1024 Can I disable the autoloading of a controllers matching table class?
# Aug 19th, 11:01 neon1024 That is the perfect face for CakeBot :,)
# Aug 19th, 11:01 slackebot Command sent from Slack by neon1024:
# Aug 19th, 11:01 slackebot !tias
# Aug 19th, 11:01 neon1024 Why not write the query and benchmark it against the ORM
# Aug 19th, 11:01 neon1024 I’d set fire to the place and find something new
# Aug 19th, 11:00 conehead As some Id's are UUIDs and some are ints
# Aug 19th, 11:00 conehead No, and I cannot :(
# Aug 19th, 10:59 neon1024 Do you have the correct indexes setup in your database?
# Aug 19th, 10:45 conehead Is using joins/explicit sql commands notably faster than using `contains`? Got rougly 2000 entries and each entry has 2 `hasOne` associations. I need all associations at the same time, so pagination is not an option. Was just wondering if I could speed it up
# Aug 19th, 10:35 dereuromark Thats documented: https://book.cakephp.org/3.0/en/development/routing.html#matching-specific-http-methods
# Aug 19th, 10:34 neon1024 Wow, when you create a route with a `->setMethod` you have to delcare the `_method` key in your Html links!
# Aug 19th, 09:37 dereuromark Thad said: Feel free to use, share and contribute.
# Aug 19th, 09:36 dereuromark For core adoption usually more than 70% would need to find them useful enough :slightly_smiling_face: Which is not often the case here, especially around opinionated topics.
# Aug 19th, 09:36 dereuromark yeah, those are opt-in fully, as such no one is required to have them. Thus a plugin.
# Aug 19th, 09:33 spriz this is another neat one I've stumbled upon https://github.com/dereuromark/executionorder
# Aug 19th, 09:32 spriz Just nice that we have access to them, but we should some kind of "New plugin on the awesome-cakephp" list announcements :)
# Aug 19th, 09:31 spriz I guess those changed are quite opinionated :) Nice way to have a "safe heaven"/playground
# Aug 19th, 09:30 neon1024 How come these kinds of enhancements don’t make it into the core? You seem to add lots of quality of life updates through plugins, when you’re in the core team
# Aug 19th, 09:29 neon1024 Very clever @dereuromark
# Aug 19th, 09:26 dereuromark @neon1024 I am using Illuminator to autocreate entity const to use in code instead of magic strings: https://github.com/dereuromark/cakephp-ide-helper/blob/master/docs/Illuminator.md Autocomplete on available fields mainly. Also a bit faster to type, but especially easier to see "usage" and make refactoring if necessary.
# Aug 19th, 09:23 dereuromark otherwise copy and paste would be also easy to do probably based on the diff.
# Aug 19th, 09:22 dereuromark Test helper already uses bake to generate missing classes, it could easily give a bake diff preview of what would change, and based on that maybe inject that if approved via single click.
# Aug 19th, 09:22 neon1024 @dereuromark Not too sure where it would fit either :slightly_smiling_face:
# Aug 19th, 09:21 neon1024 Especially as my spec I’ve been given, includes flow charts!
# Aug 19th, 09:21 dereuromark @neon1024 But maybe it would fit better in as part of https://github.com/dereuromark/cakephp-test-helper ? As the ide helper probably should stick to IDE relevant enhancements, and not re-doing bake (partially).
# Aug 19th, 09:21 neon1024 I like the definition of transition though, that’s what I was looking for. To control how states move
# Aug 19th, 09:20 neon1024 Yeah it might be. Sounds very complex
# Aug 19th, 09:19 spriz Ah, @neon1024 is this what you were looking for Friday https://github.com/spryker/cakephp-statemachine?
# Aug 19th, 09:18 neon1024 What is Illuminator?