If CMS module is loaded (and MediaManager exists) bind it

I am using OctoberCMS without the CMS module (removed from modules directory and turned off in cms.php) and I am getting an error in the backend regarding missing `MediaManager` class. I wrapped this in a class_exists to check that MediaManager exists before binding it.

Let me know your thoughts.
This commit is contained in:
dubcanada 2017-01-10 13:45:59 -04:00 committed by GitHub
parent 97b0bc481f
commit 0a4390b4d9
1 changed files with 4 additions and 2 deletions

View File

@ -153,8 +153,10 @@ class Controller extends Extendable
/*
* Media Manager widget is available on all back-end pages
*/
$manager = new MediaManager($this, 'ocmediamanager');
$manager->bindToController();
if (class_exists('\\Cms\\Widgets\\MediaManager')) {
$manager = new MediaManager($this, 'ocmediamanager');
$manager->bindToController();
}
}
/**