Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 17, 2022
1 parent 496e90a commit 7b69035
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class RootPageDependentModulesController extends AbstractFragmentController
public function __invoke(Request $request, ModuleModel $model, string $section, array $classes = null): Response
{
if (!$pageModel = $this->getPageModel()) {
return new Response(''); // This can happen in the back end preview if no module has been selected
return new Response('');
}

$modules = StringUtil::deserialize($model->rootPageDependentModules);

if (empty($modules) || !\is_array($modules) || !\array_key_exists($pageModel->rootId, $modules)) {
return new Response(''); // No need for further processing if there are no modules
return new Response('');
}

$controller = $this->container->get('contao.framework')->getAdapter(Controller::class);
Expand Down

0 comments on commit 7b69035

Please sign in to comment.