ProfessionalWiki / chameleon

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

Bug: Compatibility to wmf/1.43.0-wmf.1 #421

Closed physikerwelt closed 5 months ago

physikerwelt commented 5 months ago

We see the following error

MediaWiki internal error.

Original exception: [379c0b3b4f0d469c0efd0d48] /wiki/Model_for_Electric_Potential_for_Gate_Electrodes_in_a_Quantum_Bus TypeError: Skins\Chameleon\Chameleon::Skins\Chameleon\{closure}(): Argument #1 ($rl) must be of type ResourceLoader, MediaWiki\ResourceLoader\ResourceLoader given, called in /var/www/html/includes/HookContainer/HookContainer.php on line 159
Backtrace:
from /var/www/html/skins/chameleon/src/Chameleon.php(86)
#0 /var/www/html/includes/HookContainer/HookContainer.php(159): Skins\Chameleon\Chameleon::Skins\Chameleon\{closure}(MediaWiki\ResourceLoader\ResourceLoader)
#1 /var/www/html/includes/ResourceLoader/HookRunner.php(49): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#2 /var/www/html/includes/ServiceWiring.php(1865): MediaWiki\ResourceLoader\HookRunner->onResourceLoaderRegisterModules(MediaWiki\ResourceLoader\ResourceLoader)
#3 /var/www/html/vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer::{closure}(MediaWiki\MediaWikiServices)
#4 /var/www/html/vendor/wikimedia/services/src/ServiceContainer.php(411): Wikimedia\Services\ServiceContainer->createService(string)
#5 /var/www/html/includes/MediaWikiServices.php(355): Wikimedia\Services\ServiceContainer->getService(string)
#6 /var/www/html/includes/MediaWikiServices.php(1732): MediaWiki\MediaWikiServices->getService(string)
#7 /var/www/html/includes/Output/OutputPage.php(3635): MediaWiki\MediaWikiServices->getResourceLoader()
#8 /var/www/html/includes/Output/OutputPage.php(3400): MediaWiki\Output\OutputPage->getResourceLoader()
#9 /var/www/html/includes/Output/OutputPage.php(3443): MediaWiki\Output\OutputPage->getRlClientContext()
#10 /var/www/html/includes/Output/OutputPage.php(3544): MediaWiki\Output\OutputPage->getRlClient()
#11 /var/www/html/includes/skins/SkinTemplate.php(328): MediaWiki\Output\OutputPage->headElement(Skins\Chameleon\Chameleon)
#12 /var/www/html/skins/chameleon/src/Chameleon.php(111): SkinTemplate->prepareQuickTemplate()
#13 /var/www/html/includes/skins/SkinTemplate.php(145): Skins\Chameleon\Chameleon->prepareQuickTemplate()
#14 /var/www/html/includes/skins/SkinTemplate.php(176): SkinTemplate->generateHTML()
#15 /var/www/html/includes/Output/OutputPage.php(3005): SkinTemplate->outputPage()
#16 /var/www/html/includes/actions/ActionEntryPoint.php(162): MediaWiki\Output\OutputPage->output(boolean)
#17 /var/www/html/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#18 /var/www/html/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#19 {main}

on https://staging.mardi4nfdi.org/wiki/Model_for_Electric_Potential_for_Gate_Electrodes_in_a_Quantum_Bus after upgrading to the latest production release. I wonder if this skin is deployed on any wiki that follows the WMF release cycle, as the root cause for the problem might also be somewhere else.

malberts commented 5 months ago

It looks like the Chameleon code is likely not even compatible with the future REL1_42 yet: https://github.com/ProfessionalWiki/chameleon/pull/422

physikerwelt commented 5 months ago

@malberts, Normally, these updates are easy to fix once you find the correct phabricator ticket, which I did not manage to do in a few minutes.

physikerwelt commented 5 months ago

For this particular problem, it's just this line https://github.com/ProfessionalWiki/chameleon/blob/0225fb1e51e2401d7ab4ed25892063685080f354/src/Chameleon.php#L34 which has another namespace, but I think the full namespace needs to be added everywhere...

physikerwelt commented 5 months ago

By the way... the phabricator ticket is https://phabricator.wikimedia.org/T166010

physikerwelt commented 5 months ago

@JeroenDeDauw, what do you think?

JeroenDeDauw commented 5 months ago

@JeroenDeDauw, what do you think?

https://github.com/ProfessionalWiki/chameleon/pull/423

malberts commented 5 months ago

https://github.com/ProfessionalWiki/chameleon/pull/423 might not be enough to solve the 1.42 compatibility. There are also ResourceLoader namespace changes in the SCSS dependency, and possibly our Bootstrap extension too. I am looking at those.

malberts commented 5 months ago

@physikerwelt Can you try with the latest Chameleon master branch (which is going to be the new major version 5.0.0).

I updated the Bootstrap and SCSS dependencies and CI now passes on MW 1.42 and MW master. However, I have not manually tested either of those unreleased MW versions.

physikerwelt commented 5 months ago

Thank you. This is a great improvement. A quick update from our side:

We updated to the latest master today at 3am. The good news is, even if the skin is loaded the portal does not crash with a fatal. However, I did not manage so far to activate the skin, as I can not access the skin selection preference page due to a js error

https://staging.mardi4nfdi.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&safemode=1

does produce an invalid result:

[795e2e064f759adbd1fd0327] /w/load.php?lang=en&modules=startup&only=scripts&raw=1&safemode=1 Error: Class "ResourceLoaderSkinModule" not found

Backtrace:

from /var/www/html/includes/ResourceLoader/ResourceLoader.php(417)
#0 /var/www/html/includes/ResourceLoader/ResourceLoader.php(453): MediaWiki\ResourceLoader\ResourceLoader->getModule(string)
#1 /var/www/html/includes/ResourceLoader/StartUpModule.php(170): MediaWiki\ResourceLoader\ResourceLoader->preloadModuleInfo(array, MediaWiki\ResourceLoader\Context)
#2 /var/www/html/includes/ResourceLoader/StartUpModule.php(425): MediaWiki\ResourceLoader\StartUpModule->getModuleRegistrations(MediaWiki\ResourceLoader\Context)
#3 /var/www/html/includes/ResourceLoader/Module.php(839): MediaWiki\ResourceLoader\StartUpModule->getScript(MediaWiki\ResourceLoader\Context)
#4 /var/www/html/includes/ResourceLoader/Module.php(808): MediaWiki\ResourceLoader\Module->buildContent(MediaWiki\ResourceLoader\Context)
#5 /var/www/html/includes/ResourceLoader/Module.php(951): MediaWiki\ResourceLoader\Module->getModuleContent(MediaWiki\ResourceLoader\Context)
#6 /var/www/html/includes/ResourceLoader/ResourceLoader.php(686): MediaWiki\ResourceLoader\Module->getVersionHash(MediaWiki\ResourceLoader\Context)
#7 /var/www/html/includes/ResourceLoader/ResourceLoader.php(786): MediaWiki\ResourceLoader\ResourceLoader->getCombinedVersion(MediaWiki\ResourceLoader\Context, array)
#8 /var/www/html/includes/ResourceLoader/ResourceLoaderEntryPoint.php(53): MediaWiki\ResourceLoader\ResourceLoader->respond(MediaWiki\ResourceLoader\Context)
#9 /var/www/html/includes/MediaWikiEntryPoint.php(199): MediaWiki\ResourceLoader\ResourceLoaderEntryPoint->execute()
#10 /var/www/html/load.php(42): MediaWiki\MediaWikiEntryPoint->run()
#11 {main}

This might be unrealated... however, I just had 20 minutes for this task today and wanted to share the preminar good result with you anyhow.

malberts commented 5 months ago

Thanks @physikerwelt. That ResourceLoaderSkinModule error was indeed caused by Chameleon. I fixed it this morning and now it's loading correctly: Screenshot_20240429_114615

Screenshot_20240429_114735

physikerwelt commented 5 months ago

Thank you. Works perfect.

grafik