Logs for #cakephp

Page 6 of 36,290, showing 100 records out of 3,628,966 total, starting on record 501, ending on 600

# At Username Text
# Sep 12th, 22:57 sdevore looking in composer.lock I am running ` "version": "3.20.2"` (composer.php has “cakephp/debug_kit”: “~3.0",)
# Sep 12th, 22:54 challgren Did you upgrade debugkit?
# Sep 12th, 22:49 slackebot problem with __debuginfo() when viewing in phpstorm is making it hard for me to track down. Any one have any ideas on how to track these issues down?
# Sep 12th, 22:49 sdevore I just upgraded a client project from 3.6.x to 3.7.x and I am seeing a lot of places where I am getting errors for nesting more then 256 levels that I was not seeing before (I think it is the generation of the Variables DebugKit panel. Was there a change to the way things are marshalled or hashed that is causing this? I don’t get a stack trace reported so I can figure out where it is blowing up. This combined with xDebug seeming to throw
# Sep 12th, 20:29 challgren I wish this could be a bit more descriptive.
# Sep 12th, 16:48 this.impetus lolol I'm saving this to review on a day when I have 30+ minutes to be curious, but thanks
# Sep 12th, 16:48 jh is cakephp 3.5 running on php 7.3 without issues? where can I read about it or find out?
# Sep 12th, 16:44 jh https://www.google.com/search?client=firefox-b-d&q=declarative+shadow+dom ... missing feature
# Sep 12th, 16:43 jh one of the best things happening to css for a long time
# Sep 12th, 16:43 jh no joke.
# Sep 12th, 16:43 jh read this for more happyness: https://github.com/w3c/csswg-drafts/issues/2143
# Sep 12th, 16:43 jh (and you could group concat within SQL to fetch nested data in one query say json encoded... and then unfold the returned data struct of addresses in your application... more complex, little gain)
# Sep 12th, 16:42 jh (in theory in sql you can do all in one query but then you get duplications for the primary query... aka 10 user rows with the same user data for 10 different addresses of the same user)
# Sep 12th, 16:41 this.impetus right. k. thanks
# Sep 12th, 16:41 jh user hasMany addresses - you need to fetch all the addresses based on the foreign key so you need a separate query
# Sep 12th, 16:40 jh user hasOne profile - you can get the profile fields in the same row as the user data
# Sep 12th, 16:40 jh for hasOne or belongsTo you can return the associated data in the same table as it is only one line per association
# Sep 12th, 16:40 jh because every query only returns one "table"
# Sep 12th, 16:40 jh if it is hasMany it has to run another query
# Sep 12th, 16:39 jh if it is hasOne or belongsTo it can be done via a JOIN aka same query
# Sep 12th, 16:39 this.impetus HasMany, here
# Sep 12th, 16:39 jh @this.impetus it depends on the type of association
# Sep 12th, 16:39 jh if that was the case you could do that by widget on your website
# Sep 12th, 16:39 this.impetus Quick syntactic question; is this three queries ``` contain('Services', 'Services.Institutions' => ['fields'=> ['title']], 'Services.Serviceroles' => ['fields'=> ['title']])``` or is that just elaborating on exactly how I want `Services` and it's associations contained?
# Sep 12th, 16:38 jh now sadly there are no declarative shadow doms
# Sep 12th, 16:38 jh creating reset and default stylesheets that never annoy you
# Sep 12th, 16:38 jh you can basicall define defaults that have 0 specificity
# Sep 12th, 16:38 jh https://github.com/w3c/csswg-drafts/issues/2143
# Sep 12th, 16:38 jh here is something that will mean you can drop a lot of the preprocessing
# Sep 12th, 16:37 this.impetus we are all sinners on this Earth
# Sep 12th, 16:36 jh SCSS i hope :P
# Sep 12th, 16:36 jh SASS :(
# Sep 12th, 16:36 this.impetus haha inoas you are vastly overestimating my knowledge brother. talk to me about SASS frameworks and I can dance.
# Sep 12th, 16:36 jh there is also lazy association loading plugin which would fire queries once you access associations of entities on the fly
# Sep 12th, 16:35 jh for reference Rails's arel works the same pretty much afair
# Sep 12th, 16:35 this.impetus thanks! I mean I don't know if I'm going to make use of that today, but that's a paradigm-shifting insight (to me).
# Sep 12th, 16:35 this.impetus oh!
# Sep 12th, 16:35 this.impetus oooooh
# Sep 12th, 16:35 jh until you do that you can continue to build the query object, adding more finders, adding more conditionals etc
# Sep 12th, 16:34 jh foreach, or toArray()
# Sep 12th, 16:34 jh @this.impetus so the query builder in cakephp builds some object that then is converted to vendor specific (mariadb, postgres, etc) sql code and executed once you want to access data out of it
# Sep 12th, 16:20 this.impetus @jh It may help you to know that I am a front-end guy, haha; I loosely understand what you've said, but not really the implications beyond the simple idea that there are fast and slow, or efficient and inefficient ways to retrieve data. :S
# Sep 12th, 16:17 jh not sure about the contains though... probably only for the primary query
# Sep 12th, 16:16 jh ->sql() will get you the sql (with placeholders)
# Sep 12th, 16:16 jh afair the query builder is lazy aka if you do not fetch something from it it is just a query object
# Sep 12th, 16:16 jh toArray() will also run formatResults and not sure if only then or earlier all the accessors in the entities
# Sep 12th, 16:13 this.impetus On any other day I'd be super curious about that, haha, today is just get-to-the-finish-line. But thanks modi
# Sep 12th, 16:12 ricksaccous pretty much transforms it into an array of entities, which is great because there is a lot you can do with entity magic
# Sep 12th, 16:11 this.impetus oh thank god. :the_horns:
# Sep 12th, 16:11 ricksaccous it won't be exactly like cakephp2 but yep
# Sep 12th, 16:10 ricksaccous ->toArray
# Sep 12th, 16:10 this.impetus Last question today guys, I swear; is there any means at all of getting a query object to just dump an array of data as cake once did? One of those days where I jsut want to get the work done and do the learning on my own time...
# Sep 12th, 15:48 jh like so https://gist.github.com/inoas/1226835ee066cf54c3bf1f30b1ec028d
# Sep 12th, 15:46 jh @admad yay it works... custom AppErrorMiddleware
# Sep 12th, 15:45 jh I would be explicit about it.
# Sep 12th, 15:45 jh a references b references a
# Sep 12th, 15:45 jh @ricksaccous if you setup a recursive function, yes, but do not forget that there can be loops so you need to stop the looping
# Sep 12th, 15:43 this.impetus :slightly_smiling_face:
# Sep 12th, 15:43 ricksaccous oh well, good luck
# Sep 12th, 15:43 ricksaccous lolll
# Sep 12th, 15:43 ricksaccous 70 page CV, would anyone even read that
# Sep 12th, 15:43 this.impetus He has a 70 page CV. Guy is a luminary. Haha, but in any case, failing to have found a magic bullet, I'll just do it by hand. thanks, as usual
# Sep 12th, 15:42 ricksaccous but it also sounds like if it's just a single CV how bad could the query actually be anyway
# Sep 12th, 15:42 ricksaccous welp, good luck sounds like you could adjust the associations based on request data though
# Sep 12th, 15:41 this.impetus lol I need all the fields, haha. I'm building a digital CV for an academic who wants it utterly modular so a visitor could assemble a PDF based on which lines they want, it's a crazy amount of work to just print out what is essentially a document
# Sep 12th, 15:40 ricksaccous i know it's tedious but sometimes it's worth it
# Sep 12th, 15:40 ricksaccous you might want to specify fields in the contain array if you could
# Sep 12th, 15:40 ricksaccous really really really slow
# Sep 12th, 15:39 ricksaccous that query might be really really really slow
# Sep 12th, 15:39 this.impetus recursive retrieval is indeed what I'm after here. I can just write this out as an array, it's just tedious
# Sep 12th, 15:39 ricksaccous not just all associations on the main table
# Sep 12th, 15:39 ricksaccous it seems he wants child associations of child associations
# Sep 12th, 15:38 this.impetus @jh I'll give that a shot, thanks
# Sep 12th, 15:38 ricksaccous @jh would that work recursively though?
# Sep 12th, 15:38 jh try get_class_methods($this->Articles) should have some getAssociations() or so class
# Sep 12th, 15:37 this.impetus @ricksaccous yeah I figured. I just *actually* have a context where it is required—the relationships go several assocations deep and I actually need them all
# Sep 12th, 15:37 jh but it is bad practise
# Sep 12th, 15:37 ricksaccous so i listened
# Sep 12th, 15:37 jh you can do that by getting a list of all assocaitions from the table class
# Sep 12th, 15:37 ricksaccous then @dereuromark told me don't be a lazy boi
# Sep 12th, 15:37 ricksaccous I once wanted to contain all the associations like you
# Sep 12th, 15:37 ricksaccous so $this->find() will be sufficient
# Sep 12th, 15:36 ricksaccous and that's the default actually
# Sep 12th, 15:36 ricksaccous but find('all') is still a thing
# Sep 12th, 15:36 ricksaccous @this.impetus not really you should specify contain
# Sep 12th, 15:36 jotpe hm; I'll dig a bit, thanks @ricksaccous @inoas
# Sep 12th, 15:35 this.impetus Hey guys, is there an equivalent to this ```$this->Model->find('all')->contain('all')```?
# Sep 12th, 15:34 ricksaccous @jotpe likely an association is set up using the wrong fk/binding key
# Sep 12th, 15:33 admad @jh no, use your own table locator if you want that
# Sep 12th, 15:30 jotpe Doesn't set the fk
# Sep 12th, 15:30 jotpe Error: SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value
# Sep 12th, 15:30 jotpe but didn't seem to work neither o.O
# Sep 12th, 15:30 ricksaccous cool, glad you got it figured out
# Sep 12th, 15:30 ricksaccous lol
# Sep 12th, 15:30 jotpe I guess the problem was that 'name' wasn't $_accessible in the Entity
# Sep 12th, 15:29 jh also see this gist - automagic are bad but automagic table classes often break your code https://gist.github.com/inoas/78f24f3024a449af3e2675ae61d439b7
# Sep 12th, 15:29 jh @jotpe see my gist
# Sep 12th, 15:29 ricksaccous @jotpe to debug this first try querying the users with those associations, pay attention to the child entity names when you do this, and pay attention to the patchEntity, you should see that name resolves to an entity after patch and same for emailaddresses
# Sep 12th, 15:29 jh @jh throwing exceptions if table or entity classes are missing instead of falling back to generic/automagic tables/entities
# Sep 12th, 15:28 jh https://gist.github.com/inoas/cfa9aee7a7509e8c66e53f57f48c5687