# |
Nov 8th 2019, 08:59 |
roel |
The query is as follows: |
# |
Nov 8th 2019, 08:59 |
roel |
Hello everyone, I have a SQL query that I would like to convert to a cakephp (3.6) query, but I have no clue how to do it and if it is even possible. |
# |
Nov 8th 2019, 08:19 |
javier.villanueva |
I think that your models are different than the models im thinking |
# |
Nov 8th 2019, 08:18 |
javier.villanueva |
morning all |
# |
Nov 8th 2019, 06:36 |
conehead |
Morning! |
# |
Nov 8th 2019, 06:17 |
alexdd55976 |
Morning |
# |
Nov 8th 2019, 01:50 |
ndm |
Check `$context['newRecord']` |
# |
Nov 8th 2019, 01:47 |
francisdoydora |
thanks in advance for your help :slightly_smiling_face: |
# |
Nov 8th 2019, 01:47 |
francisdoydora |
if update, allowEmptyFile. Else if create, follow the validator rule I posted. |
# |
Nov 8th 2019, 01:37 |
slackebot1 |
(isset($context['data']['academic_level_id'])) { return $context['data']['academic_level_id'] === '1'; } return true; })``` |
# |
Nov 8th 2019, 01:37 |
francisdoydora |
if anyone could help me figure out how to return 'update' as default. But needs to return true or false on create. Right now allowEmptyFile returns false if academic_level_id is not equal to 1. But I didn't take into account if I want to edit. In edit it should always allow empty files. ```$validator ->allowEmptyFile('gmrc', 'Please upload a GMRC', function ($context) { if |
# |
Nov 7th 2019, 23:24 |
mrfeedback |
is there a way to disable a virtual field when a query is returning entities? In my case I dont need that specific field as it generates s3links which I wouldn´t use in that case. I tried to not select the field. but for some reason it still triggers |
# |
Nov 7th 2019, 22:41 |
slackebot1 |
<martonmiklosqdev> |
# |
Nov 7th 2019, 22:40 |
martonmiklosqdev |
I can see the problematic line in the variables pane: |
# |
Nov 7th 2019, 22:40 |
martonmiklosqdev |
the view errors a bit better |
# |
Nov 7th 2019, 22:40 |
martonmiklosqdev |
where the problem is in the view |
# |
Nov 7th 2019, 22:40 |
slackebot1 |
<martonmiklosqdev> |
# |
Nov 7th 2019, 22:39 |
martonmiklosqdev |
here is an another example |
# |
Nov 7th 2019, 22:39 |
martonmiklosqdev |
the problematic ItemTypesAttributesController only has 183 lines |
# |
Nov 7th 2019, 22:39 |
martonmiklosqdev |
refers to the Core/Controller.php |
# |
Nov 7th 2019, 22:38 |
martonmiklosqdev |
the line 609 |
# |
Nov 7th 2019, 22:22 |
noel |
@martonmiklosqdev As far as I can see there are line numbers... have you looked at line 609 of your Controller? |
# |
Nov 7th 2019, 22:05 |
martonmiklosqdev |
I will read back the messages tomorrow |
# |
Nov 7th 2019, 22:05 |
martonmiklosqdev |
if anyone has any idea please let me know |
# |
Nov 7th 2019, 21:40 |
martonmiklosqdev |
is it a configuration problem of the apache/PHP or is it a CakePHP config issue? |
# |
Nov 7th 2019, 21:40 |
martonmiklosqdev |
error_reporting = E_ALL |
# |
Nov 7th 2019, 21:39 |
martonmiklosqdev |
in the php.ini I set all error/debug flags |
# |
Nov 7th 2019, 21:38 |
martonmiklosqdev |
I think it is since I upgraded to PHP7 |
# |
Nov 7th 2019, 21:38 |
martonmiklosqdev |
it does not shows the problematic line number |
# |
Nov 7th 2019, 21:38 |
martonmiklosqdev |
https://i.imgur.com/SCJ9sCW.png |
# |
Nov 7th 2019, 21:38 |
martonmiklosqdev |
I have some trouble with the error pages |
# |
Nov 7th 2019, 21:37 |
martonmiklosqdev |
Hello all, |
# |
Nov 7th 2019, 17:36 |
dev.cyrusjayson |
I get error like the gave_fruits does not exist |
# |
Nov 7th 2019, 17:36 |
dev.cyrusjayson |
not yet. I will try this tomorrow. looks much easier. |
# |
Nov 7th 2019, 16:32 |
javier.villanueva |
are you tried $this->Fruits->Users->get($user_id, ['contain' => 'Fruits']) |
# |
Nov 7th 2019, 16:24 |
javier.villanueva |
what error you have? |
# |
Nov 7th 2019, 16:24 |
dev.cyrusjayson |
yes because the gave_fruits has user_id and I want to get only the data for specific user |
# |
Nov 7th 2019, 16:23 |
javier.villanueva |
the function is for passing conditions to contain |
# |
Nov 7th 2019, 16:23 |
dev.cyrusjayson |
the id is the id of gave_fruits. forget the select, could be more |
# |
Nov 7th 2019, 16:22 |
javier.villanueva |
anyway you can add conditions to contain without function |
# |
Nov 7th 2019, 16:20 |
javier.villanueva |
your gavefruits table has "id" field? |