diff --git a/application/core/Libs/FML/ManiaLink.php b/application/core/Libs/FML/ManiaLink.php index cd08629b..5e9203a6 100644 --- a/application/core/Libs/FML/ManiaLink.php +++ b/application/core/Libs/FML/ManiaLink.php @@ -273,11 +273,13 @@ class ManiaLink { $stylesheetXml = $this->stylesheet->render($domDocument); $maniaLink->appendChild($stylesheetXml); } - if ($this->script->needsRendering()) { - $scriptXml = $this->script->render($domDocument); - $maniaLink->appendChild($scriptXml); + if ($this->script) { + if ($this->script->needsRendering()) { + $scriptXml = $this->script->render($domDocument); + $maniaLink->appendChild($scriptXml); + } + $this->script->resetGenericScriptLabels(); } - $this->script->resetGenericScriptLabels(); if ($isChild) { return $maniaLink; } diff --git a/application/core/Libs/FML/Script/Features/Paging.php b/application/core/Libs/FML/Script/Features/Paging.php index 163c5ba4..4f46372c 100644 --- a/application/core/Libs/FML/Script/Features/Paging.php +++ b/application/core/Libs/FML/Script/Features/Paging.php @@ -180,6 +180,9 @@ class Paging extends ScriptFeature { * @see \FML\Script\Features\ScriptFeature::prepare() */ public function prepare(Script $script) { + if (!$this->pages) { + return $this; + } $script->setScriptInclude(ScriptInclude::TEXTLIB); $currentPageVariable = self::VAR_CURRENT_PAGE; @@ -270,6 +273,7 @@ Void {$updatePageFunction}(Text _PagingId, Text _PageLabelId, Integer _BrowseAct protected function getMinPage() { $minPageNumber = null; $minPage = null; + var_dump($this->pages); foreach ($this->pages as $page) { $pageNumber = $page->getPageNumber(); if ($minPageNumber === null || $pageNumber < $minPageNumber) { diff --git a/application/core/Update/PluginInstallMenu.php b/application/core/Update/PluginInstallMenu.php index 6e7c591b..5629d3c1 100644 --- a/application/core/Update/PluginInstallMenu.php +++ b/application/core/Update/PluginInstallMenu.php @@ -60,8 +60,6 @@ class PluginInstallMenu implements CallbackListener, ConfiguratorMenu, Manialink */ public function getMenu($width, $height, Script $script) { $paging = new Paging(); - $script->addFeature($paging); - $paging = new Paging(); $script->addFeature($paging); $frame = new Frame();