Do associations work in cells ?
does not work in my cells and return an error message (is not associated).
Associations works everywhere else in my app.
Commenting the line make cell work but I miss the associated data.
Yes they work, could you paste that cumbersome code?
This cell is within Medias plugin.
you have nothing in
Dossiers, so you need to pass anything in
->select from it or
->enableAutofields(true) or pass whole schema
Thank you for trying to help.
I use contain([‘Dossiers’]) in some table methods or in my controller and it works perfectly.
But I tried your way and get the same result :
Warning (512): Could not render cell - Fichiers is not associated with Dossiers [/home/wmcmiinz/www/matapeste_2018/vendor/cakephp/cakephp/src/ORM/EagerLoader.php, line 428] [CORE/src/View/Cell.php, line 271]
can you post your
I GOT IT !
Even though the cell is within a plugin, you have to specify the plugin name.
So you must load your model this way : $this->loadModel(‘Medias.Fichiers’);
Hope it helps someone.
Thank you everybody for your time and knowledge.
Well, I was wondering if this could be considered almost a bug ?
When you are inside a plugin namespace, you should not have to add the plugin name.
I started with “namespace Medias\View\Cell;” (Medias is the plugin name)
Or maybe I forgot or missed something.
In most cases (plugin extends the core functionality of app), it’s handier when its done this way coz by default plugins are loading app models.