We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49481
    • 32 Posts
    Quote from: reginald at Feb 05, 2015, 05:25 AM
    Firebug is showing a 500 Internal Server Error and my server's PHP error log shows the following:

    [Thu Feb 05 19:13:35.070229 2015] [:error] [pid 4761] [client 127.0.0.1:39177] PHP Fatal error:  Class 'DoodlesIndexManagerController' not found in /var/www/html/modxsdk/core/model/modx/modmanagerresponse.class.php on line 185, referer: http://localhost/modxsdk/manager/



    I'm not sure where the "DoodlesIndexManagerController" is coming from because in my index.class.php file I've just got DoodlesManagerController extending modExtraManagerController .....


    After some playing around, it seems that MODX prefixes the name of your controller with your namespace. Thus, my "IndexManagerController" becomes "DoodlesIndexManagerController". I tried with another namespace "Doodles2" and it became "Doodles2IndexManagerController".

      • 49481
      • 32 Posts
      Because I got frustrated, I did a fresh MODX 2.3.3 Traditional install.

      I followed the instructions at http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/custom-manager-pages/custom-manager-pages-in-2.3 exactly. Also on a different machine and different OS just to be sure.

      My error message is now:
      Fatal error: Class 'MycmpIndexManagerController' not found in C:\xampp\htdocs\modxdev\core\model\modx\modmanagerresponse.class.php on line 185


      If this is working for other people I must be missing something rather fundamental here.


      EDIT: Ok I've found something. If I name the controller index.class.php it doesn't work. If I name it anything else it does work. e.g. home.class.php, welcome.class.php, anything.class.php.

      Why not index?

      I'll leave this unanswered and test some more for now. [ed. note: reginald last edited this post 11 years, 7 months ago.]
      • discuss.answer
        • 49481
        • 32 Posts
        OK Solved. For some reason I'm oblivious to, my controller wasn't allowed to be called IndexManagerController however AnythingIndexManagerController was fine. Or more specifically: DoodlesIndexManagerController.

        To get it working beyond that, I removed the abstract class declaration and extended the modExtraManagerController directly as Mark had recommended in that other thread linked above.

        In the hope it helps anyone else having trouble:

        1. I deleted home.class.php from /www/doodles/core/components/doodles/controllers/
        2. I moved index.class.php from /www/doodles/core/components/doodles/ to /www/doodles/core/components/doodles/controllers/

        The new contents of the index.class.php file should be:
        <?php
        require_once dirname(dirname(__FILE__)) . '/model/doodles/doodles.class.php';
        /**
         * @package doodles
         */
        class DoodlesIndexManagerController extends modExtraManagerController {
            /** @var Doodles $doodles */
             public $doodles;
             public function initialize() {
                 $this->doodles = new Doodles($this->modx);
        
                 $this->addCss($this->doodles->config['cssUrl'].'mgr.css');
                 $this->addJavascript($this->doodles->config['jsUrl'].'mgr/doodles.js');
                 $this->addHtml('<script type="text/javascript">
                 Ext.onReady(function() {
                     Doodles.config = '.$this->modx->toJSON($this->doodles->config).';
                 });
                 </script>');
                 return parent::initialize();
             }
             public function getLanguageTopics() {
                 return array('doodles:default');
             }
             public function checkPermissions() { return true;}
        
             public function process(array $scriptProperties = array()) {}
        
             public function getPageTitle() { return $this->modx->lexicon('doodles'); }
        
             public function loadCustomCssJs() {
                 $this->addJavascript($this->doodles->config['jsUrl'].'mgr/widgets/doodles.grid.js');
                 $this->addJavascript($this->doodles->config['jsUrl'].'mgr/widgets/home.panel.js');
                 $this->addLastJavascript($this->doodles->config['jsUrl'].'mgr/sections/index.js');
             }
        
             public function getTemplateFile() {
                 return $this->doodles->config['templatesPath'].'home.tpl';
             }
        }