# |
Apr 30th 2019, 03:39 |
voycey |
Hey folks, we are migrating from MySQL to Postgres and we are seeing a few errors popping up, namely this one: `Grouping error: 7 ERROR: column "impressions.id" must appear in the GROUP BY clause or be used in an aggregate function` |
# |
Apr 29th 2019, 22:42 |
alysson-azevedo |
(i'm not using the default hasMany because i need another table to make the join works, and the hasMany association doesn't have the `through` option) |
# |
Apr 29th 2019, 22:35 |
slackebot |
laboratories and and each entity have one medicine. Is it possible to tell the join to create an "hasMany" relation? |
# |
Apr 29th 2019, 22:35 |
alysson-azevedo |
Hi. I have a model called LaboratoriesTable, and for i need return the list of medicines that each laboratory makes. ``` $query->select(['medicines.id', 'medicines.ean', 'medicines.cap']) ->join([ 'medicines' => [ 'table' => 'medicines', 'type' => 'left', 'conditions' => 'medicines.id = laboratory.id', ], ]); ``` This query almost works, the problem is that it duplicates the |
# |
Apr 29th 2019, 21:25 |
ricksaccous |
np |
# |
Apr 29th 2019, 21:24 |
maymeow |
@ricksaccous thank you |
# |
Apr 29th 2019, 21:22 |
ricksaccous |
@maymeow https://github.com/cakephp/cakephp/blob/master/tests/TestCase/View/Helper/TimeHelperTest.php |
# |
Apr 29th 2019, 21:14 |
maymeow |
Hi. Please do you have any Helper test example for cakephp 3.7? |
# |
Apr 29th 2019, 20:58 |
rightscoreanalysis |
restful routing for an add action is POST: /users.json isn't it? |
# |
Apr 29th 2019, 18:40 |
noel |
@neon1024 and @hollistergraham123 thanks for the offers of help! So far I seem to be managing. My approach is a little different – it’s not using Vue as SPA with CakePHP as API, rather it’s just integrating the Quasar UI framework in such a way as to dress the standard web-app scaffolding created by Bake. So there’s no ajax going on. Don’t know if anyone else would agree that is useful but I’m digging it. |
# |
Apr 29th 2019, 17:55 |
ricksaccous |
oh ok ;) cool |
# |
Apr 29th 2019, 17:55 |
itmpls |
n/m, actually default is true to mimic mysql, it was just not setting the right prop :slightly_smiling_face: |
# |
Apr 29th 2019, 17:54 |
ricksaccous |
@itmpls are you setting it to an empty string or is it actually null? |
# |
Apr 29th 2019, 17:21 |
itmpls |
no unique index in the table itself |
# |
Apr 29th 2019, 17:21 |
itmpls |
I supplied that as an option (set to true) but it still doesn't appear to allow multiple nulls |
# |
Apr 29th 2019, 17:21 |
itmpls |
anyone know how allowMultipleNulls works in conjunction with isUnique validation? |
# |
Apr 29th 2019, 14:57 |
ricksaccous |
no problem |
# |
Apr 29th 2019, 14:55 |
neon1024 |
Try using `Log::debug()` instead, I’ve had issues trying to echo from inside a closure |
# |
Apr 29th 2019, 14:54 |
itmpls |
this is for an associated model, the first debug is hit |
# |
Apr 29th 2019, 14:54 |
itmpls |
anyone know why the 'on' callback is never reached despite there being an email field? https://gist.github.com/medero/fdbb2aff8efa08bc6376e557c33a3963 |
# |
Apr 29th 2019, 13:12 |
fra.bdn |
It looks like it worked, thanks! public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) { if (isset($data['short_code'])) { if($data['short_code'] == ''){ $data['short_code'] = NULL; } } } |
# |
Apr 29th 2019, 12:57 |
ricksaccous |
meh |
# |
Apr 29th 2019, 12:57 |
ricksaccous |
actually maybe it's fine |
# |
Apr 29th 2019, 12:57 |
ricksaccous |
to me that's a quick/dirty solution, heh |
# |
Apr 29th 2019, 12:56 |
ricksaccous |
you could prob just set it as null if it's empty string in beforeMarshall if you want |
# |
Apr 29th 2019, 12:55 |
fra.bdn |
Looks like $this->request->getData()['short_code'] returns "". |
# |
Apr 29th 2019, 12:51 |
ricksaccous |
or is it being set as empty string? |
# |
Apr 29th 2019, 12:51 |
ricksaccous |
strange, are you sure it's being set as null |
# |
Apr 29th 2019, 12:51 |
fra.bdn |
And even setting it explicitely to true, the form does not save. |
# |
Apr 29th 2019, 12:49 |
ricksaccous |
my bad |
# |
Apr 29th 2019, 12:49 |
fra.bdn |
yes, that's why I was asking. |
# |
Apr 29th 2019, 12:49 |
ricksaccous |
allowMultipleNulls |
# |
Apr 29th 2019, 12:49 |
ricksaccous |
but it does say it's set to true by default, the option is called |
# |
Apr 29th 2019, 12:48 |
ricksaccous |
oh it does |
# |
Apr 29th 2019, 12:48 |
ricksaccous |
I'm not sure if isUnique has that option |
# |
Apr 29th 2019, 12:48 |
ricksaccous |
oh wait sorry i was thinking existsIn |
# |
Apr 29th 2019, 12:47 |
ricksaccous |
@fra.bdn yeah what @dereuromark said |
# |
Apr 29th 2019, 12:46 |
dereuromark |
it might/could if one programs it in. |
# |
Apr 29th 2019, 12:46 |
dereuromark |
i dont think rules code knows about foreign key or not. it just sees all equal. |
# |
Apr 29th 2019, 12:46 |
fra.bdn |
even if that's not a foreign key? |
# |
Apr 29th 2019, 12:45 |
ricksaccous |
and set that to true |