# |
Jul 5th 2017, 15:36 |
neon1024 |
How do I access the ‘[original]’ in the entity? |
# |
Jul 5th 2017, 15:36 |
juststeveking |
500 :anguished: |
# |
Jul 5th 2017, 15:36 |
jeremyharris |
throw it in your app controller before filter maybe. You might need to do $db = ConnectionManager::get(‘default’); debug($db->listSources()); die; |
# |
Jul 5th 2017, 15:36 |
juststeveking |
That is erroring |
# |
Jul 5th 2017, 15:35 |
juststeveking |
It doesnt seem to like me |
# |
Jul 5th 2017, 15:34 |
jeremyharris |
we just want to see what tables cake is getting from the database |
# |
Jul 5th 2017, 15:34 |
jeremyharris |
just to see (needs to happen after datasources are configured of course) |
# |
Jul 5th 2017, 15:33 |
jeremyharris |
debug and die |
# |
Jul 5th 2017, 15:33 |
jeremyharris |
yeah run it in the bootstrap/core |
# |
Jul 5th 2017, 15:32 |
juststeveking |
I just run that one in my cod? |
# |
Jul 5th 2017, 15:32 |
jeremyharris |
ConnectionManager::getDataSource(‘default’)->listSources() |
# |
Jul 5th 2017, 15:29 |
juststeveking |
Thanks! I have created those directories (didn't exsist) |
# |
Jul 5th 2017, 15:29 |
jeremyharris |
lemme find the code to list all tables that cake sees |
# |
Jul 5th 2017, 15:29 |
jeremyharris |
okay, just checking :slightly_smiling_face: |
# |
Jul 5th 2017, 15:28 |
juststeveking |
It is, but I don't know, it is odd (I didnt build it) |
# |
Jul 5th 2017, 15:28 |
jeremyharris |
if so, clear it out |
# |
Jul 5th 2017, 15:28 |
jeremyharris |
is there anything in app/tmp/cache/models or persistent? |
# |
Jul 5th 2017, 15:28 |
jeremyharris |
well your app could not be respecting that env file |
# |
Jul 5th 2017, 15:27 |
juststeveking |
In the `.env` file I have: `CACHE_DISABLE=1` |
# |
Jul 5th 2017, 15:27 |
juststeveking |
there is no cache enabled at the moment :S |
# |
Jul 5th 2017, 15:27 |
jeremyharris |
rm app/tmp/cache/cake_core* maybe |
# |
Jul 5th 2017, 15:26 |
jeremyharris |
testing my memory here :P |
# |
Jul 5th 2017, 15:26 |
juststeveking |
It is cake 2 if that helps |
# |
Jul 5th 2017, 15:26 |
jeremyharris |
have you cleared the orm cache? bin/cake orm_cache clear |
# |
Jul 5th 2017, 15:26 |
juststeveking |
I ran the migration and could qery rather easily |
# |
Jul 5th 2017, 15:26 |
juststeveking |
:slightly_smiling_face: |
# |
Jul 5th 2017, 15:26 |
juststeveking |
It is definately in the db |
# |
Jul 5th 2017, 15:25 |
jeremyharris |
did you confirm that the table does exist in that datasource? |
# |
Jul 5th 2017, 15:24 |
juststeveking |
Anybody encountered this error before: `Table asbaudits for model Audit was not found in datasource default.` |
# |
Jul 5th 2017, 15:08 |
jeremyharris |
np |
# |
Jul 5th 2017, 15:08 |
jeremyharris |
ah, cool. glad you got it working! |
# |
Jul 5th 2017, 15:08 |
pedroseco |
thanks for pointing me on the right direction |
# |
Jul 5th 2017, 15:08 |
pedroseco |
yes |
# |
Jul 5th 2017, 15:05 |
jeremyharris |
does posts belongsToMany files too? |
# |
Jul 5th 2017, 15:05 |
pedroseco |
and: $this->Posts->save($post,[‘associated’=>[‘Files._joinData’]]) |
# |
Jul 5th 2017, 15:05 |
pedroseco |
the array saved it. |
# |
Jul 5th 2017, 15:05 |
pedroseco |
so instead of the newEntity like we tried: $this->request->data[‘files’][$c][‘file_id’] = $value; $this->request->data[‘files’][$c][‘_joinData’][‘sort’] = 2; |
# |
Jul 5th 2017, 15:04 |
jeremyharris |
woohoo! what was it? |
# |
Jul 5th 2017, 15:04 |
pedroseco |
@jeremyharris hey. got it too work :) |
# |
Jul 5th 2017, 14:50 |
pedroseco |
thanks |
# |
Jul 5th 2017, 14:47 |
jeremyharris |
you may want to debug the entity that is returned when doing a find from Files that includes Posts, that will show you the structure you need |