From bc9e0da5bb10ce430df72b42d9f310b263c33695 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:15:04 +0200 Subject: [PATCH 1/4] Update ParserFunction.php --- src/ParserFunction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ParserFunction.php b/src/ParserFunction.php index a690274..da54606 100644 --- a/src/ParserFunction.php +++ b/src/ParserFunction.php @@ -92,7 +92,7 @@ public static function getTournamentsList( $content, $attributes, $parser, $fram } } elseif ( array_key_exists( 'iconfile', $tournament ) ) { $iconfileTitle = Title::newFromText( - $iconTemplatePrefix . '/mainpageTST', + $iconTemplatePrefix . '/custom', NS_TEMPLATE ); if ( @@ -105,7 +105,7 @@ public static function getTournamentsList( $content, $attributes, $parser, $fram $wasParserReportEnabled = $parserOptions->getOption( 'enableLimitReport' ); $parserOptions->setOption( 'enableLimitReport', false ); $iconHTML = $parser->parse( - '{{' . $iconTemplatePrefix . '/mainpageTST|' . + '{{' . $iconTemplatePrefix . '/custom|' . ( array_key_exists( 'icondarkfile', $tournament ) ? 'iconDark=' . $tournament[ 'icondarkfile' ] . '|' : '' ) . From 6ddac37113711afff2d6fbb4d781f41352a24912 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:15:47 +0200 Subject: [PATCH 2/4] Update MainHookHandler.php --- src/Hooks/MainHookHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hooks/MainHookHandler.php b/src/Hooks/MainHookHandler.php index 1cf9478..58cb914 100644 --- a/src/Hooks/MainHookHandler.php +++ b/src/Hooks/MainHookHandler.php @@ -78,13 +78,13 @@ public function onSkinBuildSidebar( $skin, &$bar ) { } } elseif ( array_key_exists( 'iconfile', $tournament ) ) { $iconfileTitle = Title::newFromText( - $iconTemplatePrefix . '/mainpageTST', + $iconTemplatePrefix . '/custom', NS_TEMPLATE ); if ( $iconfileTitle !== null && $iconfileTitle->exists() && $skin->getTitle() !== null ) { if ( !$commandLineMode ) { $iconHTML = $out->parseInlineAsInterface( - '{{' . $iconTemplatePrefix . '/mainpageTST|' . + '{{' . $iconTemplatePrefix . '/custom|' . ( array_key_exists( 'icondarkfile', $tournament ) ? 'iconDark=' . $tournament[ 'icondarkfile' ] . '|' : '' ) . From cd740a56facfc55b95c22f4b89af497e16c0e332 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:48:40 +0200 Subject: [PATCH 3/4] can't be null and we want to expand from commons --- src/Hooks/MainHookHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hooks/MainHookHandler.php b/src/Hooks/MainHookHandler.php index 58cb914..1e0a45a 100644 --- a/src/Hooks/MainHookHandler.php +++ b/src/Hooks/MainHookHandler.php @@ -64,7 +64,7 @@ public function onSkinBuildSidebar( $skin, &$bar ) { $iconTemplatePrefix . '/' . $tournament[ 'icon' ], NS_TEMPLATE ); - if ( $iconTitle !== null && $iconTitle->exists() && $skin->getTitle() !== null ) { + if ( $skin->getTitle() !== null ) { if ( !$commandLineMode ) { $iconHTML = $out->parseInlineAsInterface( '{{' . $iconTemplatePrefix . '/' . $tournament[ 'icon' ] . '|link=}}', From 6233d2389122b81b35d55ba00551bdfa2edb2ead Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:53:02 +0200 Subject: [PATCH 4/4] do it in correct line... --- src/Hooks/MainHookHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hooks/MainHookHandler.php b/src/Hooks/MainHookHandler.php index 1e0a45a..430fa0f 100644 --- a/src/Hooks/MainHookHandler.php +++ b/src/Hooks/MainHookHandler.php @@ -64,7 +64,7 @@ public function onSkinBuildSidebar( $skin, &$bar ) { $iconTemplatePrefix . '/' . $tournament[ 'icon' ], NS_TEMPLATE ); - if ( $skin->getTitle() !== null ) { + if ( $iconTitle !== null && $iconTitle->exists() && $skin->getTitle() !== null ) { if ( !$commandLineMode ) { $iconHTML = $out->parseInlineAsInterface( '{{' . $iconTemplatePrefix . '/' . $tournament[ 'icon' ] . '|link=}}', @@ -81,7 +81,7 @@ public function onSkinBuildSidebar( $skin, &$bar ) { $iconTemplatePrefix . '/custom', NS_TEMPLATE ); - if ( $iconfileTitle !== null && $iconfileTitle->exists() && $skin->getTitle() !== null ) { + if ( $skin->getTitle() !== null ) { if ( !$commandLineMode ) { $iconHTML = $out->parseInlineAsInterface( '{{' . $iconTemplatePrefix . '/custom|' .