Skip to content

Commit

Permalink
Fix derivative loading in ResourceManagerController
Browse files Browse the repository at this point in the history
  • Loading branch information
opengeek committed Jul 9, 2019
1 parent 81e354c commit 81fe79a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manager/controllers/default/resource/resource.class.php
Expand Up @@ -93,14 +93,14 @@ public static function getInstance(modX &$modx, $className, array $config = [])
}

if ($isDerivative) {
$resourceClass = str_replace(['../', '..', '/', '\\'], '', $resourceClass);
$resourceClass = str_replace(['../', '..', '/'], '', $resourceClass);
if (!class_exists($resourceClass) && !$modx->loadClass($resourceClass)) {
$resourceClass = modDocument::class;
}

$delegateView = $modx->call($resourceClass, 'getControllerPath', [&$modx]);
$action = strtolower(str_replace(['Resource', 'ManagerController'], '', $className));
$className = str_replace('mod', '', $resourceClass) . ucfirst($action) . 'ManagerController';
$className = str_replace('mod', '', $modx->getAlias($resourceClass)) . ucfirst($action) . 'ManagerController';
$controllerFile = $delegateView . $action . '.class.php';
if (!file_exists($controllerFile)) {
// We more than likely are using a custom manager theme without overridden controller, let's try with the default theme
Expand Down

0 comments on commit 81fe79a

Please sign in to comment.