Log message #4121647

# At Username Text
# Mar 4th 2018, 03:41 neothermic not really, they're a bit complex. (yay for JS-generated form elements) :P
# Mar 4th 2018, 03:40 savant can you show the form and the code that you are calling to save it?
# Mar 4th 2018, 03:39 neothermic So, calling Consent->saveAssociated on this data: ```array('Consent' => array( 'id' => '8' ),'Topic' => array((int) 1 => '1',(int) 2 => '2'))``` Doesn't seem to write data to the consents_topics table, despite the two models having a HABTM relationship defined. Am I missing something? :|
# Mar 4th 2018, 03:34 savant mrr mrr
# Mar 4th 2018, 03:33 neothermic mrr, HABTM data.. mrr
# Mar 4th 2018, 03:13 mikesmoniker Cheers! Good night.
# Mar 4th 2018, 03:12 savant cool beans :slightly_smiling_face:
# Mar 4th 2018, 03:12 mikesmoniker Calling toArray() instead of execute()->fetchAll() gets me what I want though.
# Mar 4th 2018, 03:09 mikesmoniker Well actually I guess it’s not quite working.. the query results aren’t keyed by my select() keys, it’s just a numeric array. But it’s progress.
# Mar 4th 2018, 03:08 mikesmoniker Thank you.
# Mar 4th 2018, 03:08 savant thanks :slightly_smiling_face:
# Mar 4th 2018, 03:07 mikesmoniker Sure. It might take me a bit to figure out a small reproducible example, but I’ll see what I can do.
# Mar 4th 2018, 03:07 savant mind filing an issue so we can investigate?
# Mar 4th 2018, 03:07 savant That sounds like maybe a bug
# Mar 4th 2018, 03:06 mikesmoniker But `'learners' => $query->newExpr()->add('COUNT(*)')` works fine.
# Mar 4th 2018, 03:06 mikesmoniker Yeah.
# Mar 4th 2018, 03:05 savant still fails?
# Mar 4th 2018, 03:05 mikesmoniker Well, Slack mangled that, but yeah.
# Mar 4th 2018, 03:05 mikesmoniker Also, if I remove learners from select and the join/groupby it still fails, even though the resulting SQL is: `SELECT (COUNT(*)) AS `count` FROM targets Targets WHERE customer_id = 112;`
# Mar 4th 2018, 03:05 savant i wonder whats so special about the count
# Mar 4th 2018, 03:05 savant thats interesting
# Mar 4th 2018, 03:04 mikesmoniker Yeah.
# Mar 4th 2018, 03:00 savant does bucket work?
# Mar 4th 2018, 03:00 savant what happens if you remove that?
# Mar 4th 2018, 02:51 mikesmoniker It looks like `$this->_typeMap['learners']` exists but `$row['learners']` does not. $row is a numerically keyed array.
# Mar 4th 2018, 02:45 savant @markstory any idea what might be going on above?
# Mar 4th 2018, 02:45 mikesmoniker 3.5.11
# Mar 4th 2018, 02:45 savant seems the `learners` column is not in the type map
# Mar 4th 2018, 02:44 savant what version of cakephp is this?
# Mar 4th 2018, 02:44 savant heh my next question was going to be “what is that”
# Mar 4th 2018, 02:43 mikesmoniker File uploaded https://cakesf.slack.com/files/U67NZSL1G/F9J9UB285/screen_shot_2018-03-03_at_8.43.30_pm.png / https://slack-files.com/T053DPNCM-F9J9UB285-efc0527f20
# Mar 4th 2018, 02:43 mikesmoniker What I expect..
# Mar 4th 2018, 02:43 savant what is the result of the query when run directly
# Mar 4th 2018, 02:42 savant thats.. interesting
# Mar 4th 2018, 02:34 mikesmoniker Anyone know what’s up here? https://pastebin.com/ms2tUxcr ORM is generating the right query but seems to be having problems handling the result.
# Mar 3rd 2018, 23:03 savant night!
# Mar 3rd 2018, 23:03 obinoob savant thank you again sleeping time ;)
# Mar 3rd 2018, 23:00 savant heh
# Mar 3rd 2018, 22:56 obinoob I'm learning as I go it has fewer results but I need to work to put food on the table eheheh
# Mar 3rd 2018, 22:54 obinoob savant I read cakephp all the time but too many subjects... can only grasp a few :) my next step is about business domain rules! I think that cakephp is missing quite a few things here (and I know about skinny controllers fat models and I like it!). However, sometimes is not enough...
# Mar 3rd 2018, 22:47 savant no problem! just be patient and stick with it :slightly_smiling_face: