diff --git a/src/Resources/contao/Module.php b/src/Resources/contao/Module.php index e32b46a..8566bff 100644 --- a/src/Resources/contao/Module.php +++ b/src/Resources/contao/Module.php @@ -20,7 +20,19 @@ public function __construct($id) $this->model = ModuleModel::findByPk($id); $moduleClass = Module::findClass($this->type); try { - $module = new $moduleClass($this->model, null); + $strColumn = null; + // Add compatibility to new front end module fragments + if(defined('VERSION')) + { + if (version_compare(VERSION, '4.5', '>=')) + { + if ($moduleClass === ModuleProxy::class) + { + $strColumn = 'main'; + } + } + } + $module = new $moduleClass($this->model, $strColumn); $this->compiledHTML = @$module->generate() ?? null; } catch (\Exception $e) { $this->compiledHTML = null;