ProfessionalWiki / chameleon

Provides a highly flexible and customizable skin using Bootstrap 4
https://www.mediawiki.org/wiki/Skin:Chameleon
Other
115 stars 63 forks source link

Enabling Chameleon skin leads to Exception #338

Closed iusgit closed 2 years ago

iusgit commented 2 years ago

Hello,

just installed a fresh Mediawiki + SMW and wanted to add the Chameleon skin.

My setup is: MediaWiki | 1.37.3 PHP | 7.4.30 (apache2handler) Chameleon | 4.1.0 MonoBook | – Vector | 1.0.0 Semantic Compound Queries | 2.2.0 Semantic MediaWiki | 4.0.1

I installed Chameleon with composer: COMPOSER=composer.local.json composer require mediawiki/chameleon-skin "~4.1" --no-update \ && composer update mediawiki/chameleon-skin -o

and added in LocalSettings.php:

wfLoadExtension( 'Bootstrap' );
wfLoadSkin( 'chameleon' );

However, switching to Chameleon leads to following trace:

MediaWiki internal error.

Original exception: [7494ea8e55926ad2d2183a4c] /index.php?title=Main_Page&useskin=chameleon MWException: HTML attribute src can not contain a list of values
Backtrace:
from /var/www/html/includes/Html.php(552)
#0 /var/www/html/includes/Html.php(306): Html::expandAttributes(array)
#1 /var/www/html/includes/Html.php(211): Html::openElement(string, array)
#2 /var/www/html/skins/chameleon/src/IdRegistry.php(114): Html::rawElement(string, array, string)
#3 /var/www/html/skins/chameleon/src/Components/Logo.php(68): Skins\Chameleon\IdRegistry->element(string, array)
#4 /var/www/html/skins/chameleon/src/Components/Logo.php(50): Skins\Chameleon\Components\Logo->getLogo()
#5 /var/www/html/skins/chameleon/src/Components/Structure.php(54): Skins\Chameleon\Components\Logo->getHtml()
#6 /var/www/html/skins/chameleon/src/Components/Container.php(63): Skins\Chameleon\Components\Structure->getHtml()
#7 /var/www/html/skins/chameleon/src/Components/Structure.php(54): Skins\Chameleon\Components\Container->getHtml()
#8 /var/www/html/skins/chameleon/src/Components/Container.php(63): Skins\Chameleon\Components\Structure->getHtml()
#9 /var/www/html/skins/chameleon/src/Components/Structure.php(54): Skins\Chameleon\Components\Container->getHtml()
#10 /var/www/html/skins/chameleon/src/Components/Container.php(63): Skins\Chameleon\Components\Structure->getHtml()
#11 /var/www/html/skins/chameleon/src/Components/Structure.php(54): Skins\Chameleon\Components\Container->getHtml()
#12 /var/www/html/skins/chameleon/src/ChameleonTemplate.php(50): Skins\Chameleon\Components\Structure->getHtml()
#13 /var/www/html/includes/skins/SkinTemplate.php(129): Skins\Chameleon\ChameleonTemplate->execute()
#14 /var/www/html/includes/skins/SkinTemplate.php(144): SkinTemplate->generateHTML()
#15 /var/www/html/includes/OutputPage.php(2644): SkinTemplate->outputPage()
#16 /var/www/html/includes/MediaWiki.php(946): OutputPage->output(boolean)
#17 /var/www/html/includes/MediaWiki.php(959): MediaWiki::{closure}()
#18 /var/www/html/includes/MediaWiki.php(563): MediaWiki->main()
#19 /var/www/html/index.php(53): MediaWiki->run()
#20 /var/www/html/index.php(46): wfIndexMain()
#21 {main}

Any ideas around what happens?

Kind regards, Maarten

malberts commented 2 years ago

Since the stacktrace refers to the Logo component, can you show how you defined your logo in LocalSettings.php?

And are you using a custom layout or the default?

iusgit commented 2 years ago

Thanks for asking the right question!

I had $wgLogo intermixed with the new array format of $wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/wiki.png" ];, which caused the error.

I can confirm that using either $wgLogo as string or $wgLogos as associative array work without problems...

Thank you again!