I am consistently getting an error when navigating between CakePHP plugins (that I coded).
I bootstrap them like this:
CakePlugin::loadAll(array(
'OneTime' => array('bootstrap' => true),
'Mango' => array('bootstrap' => true),
'Intercape' => array('bootstrap' => true)
));
I link to them like this:
echo $this->Html->link($image,array('plugin'=>'intercape','controller'=>'tickets','action'=>'StepOne','agent'=>FALSE),array('escape'=>FALSE));
echo $this->Html->link($image,array('plugin'=>'mango','controller'=>'tickets','action'=>'StepOne','agent'=>FALSE),array('escape'=>FALSE));
I can clear my cache and navigate to a plugin, but if I use a link like the following one to go to the home page then the next time I try to click the other link I get a bug.
Clicking this link
echo $this->Html->link($image,array('plugin'=>'','controller'=>'agentusers','action'=>'dashboard','agent'=>TRUE), array('escape'=>FALSE));
gives this bug the next time I click the Intercape link (not the Mango link)
Fatal error: Class ‘MangoAppController’ not found in /var/www/mtn/app/Plugin/Mango/Controller/TicketsController.php on line 12
I have checked that Intercape does not reference Mango anywhere. Clearing my cache lets me click Intercape and use the plugin, but then Mango won’t work.
It turns out that the problem was in using the same controller name in different plugins.
Cake was caching where to look for controller source across plugin requests and so was looking for the wrong code.
Renaming the controller solved the problem, but made the URL’s a bit messy 🙁