We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36695
    • 47 Posts
    If you have a different theme installed in the manager, and have added controllers for that theme in manager/controllers, then Articles breaks on create or update of a container or Article.

    In {core}/components/articles/controllers/article and {core}/components/articles/controllers/container, the files all load the base controller class using a line like:
    require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/default/resource/update.class.php';

    This obviously loads the class from the default controllers directory. However, if you have alternative controllers it doesn't work (you just get a white screen of death when trying to create/edit). I've fixed this by using:
    require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/'.$modx->getOption('manager_theme',null,'default').'controllers/default/resource/update.class.php';

    In addition, I've sometimes had multiple class warnings, and so have needed to add a wrapper thus:
    if(!class_exists('ResourceCreateManagerController')) {
    require_once $modx->getOption('manager_path',null,MODX_MANAGER_PATH).'controllers/'.$modx->getOption('manager_theme',null,'default').'/resource/create.class.php';
    }

    Has anyone else encountered this? I know it only comes about when having non-default controllers, but they are essential if you want a manager theme to persist throughout all update/create operations (some actions check for the existence of a custom controller and if it's not there erroneously load the default theme).
      • 38290
      • 712 Posts
      Thank you for discovering this. Could you log a bug here?
      http://github.com/modxcms/Articles/issues
        jpdevries