Page MenuHomePhabricator

Example Skin looks broken with MediaWiki 1.35.1
Open, Stalled, Needs TriagePublicBUG REPORT

Assigned To
None
Authored By
Nasirkhan
Jan 10 2021, 6:48 PM
Referenced Files
F34019795: image(1).jpg
Jan 25 2021, 9:08 AM
F34019796: image(2).jpg
Jan 25 2021, 9:08 AM
F34019793: image.jpg
Jan 25 2021, 9:08 AM
F33994720: Screen Shot 2021-01-10 at 4.43.14 PM.png
Jan 11 2021, 12:45 AM
F33994451: Screenshot_2021-01-11 MediaWikiBootstrap.png
Jan 10 2021, 6:48 PM

Description

Steps to Reproduce:
  1. Install MediaWiki 1.35.1
  2. Download Example Skin from Github (https://github.com/wikimedia/mediawiki-skins-Example)
  3. Install the skin and set as default
  4. visit Main page of the Wiki
Actual Results:

Page looks like the CSS is missing.

Screenshot_2021-01-11 MediaWikiBootstrap.png (775×957 px, 39 KB)

Expected Results:

Visually decent looking skin. But if the attached screenshot is the way it is then I am wrong and there is no bug.

Event Timeline

Unable to reproduce with 1.35 release. I suspect there is not an issue with the Example skin here, as the page is rendering fine.

Screen Shot 2021-01-10 at 4.43.14 PM.png (1×2 px, 104 KB)

Cn you provide more information on what you are seeing in the network tab? I suspect there is an error in the stylesheet itself.

Please subsitute with your own localhost, but tell me if you see any errors in http://localhost:8888/w/load.php?lang=en&modules=skins.example&only=styles&skin=example - ideally copy and paste the text of the error rather than taking a screenshot.

Did you run composer install per the mediawiki install instructions?

@Nasirkhan: Could you please answer the last comment? Thanks in advance!

@Jdlrobson I used tar archive to install mediawiki and i did not run any composer update. I did not see any error on console or network tab. So here I am sharing the some screenshots again

image.jpg (956×1 px, 142 KB)

image(2).jpg (956×1 px, 183 KB)

image(1).jpg (956×1 px, 113 KB)

Jdlrobson changed the task status from Open to Stalled.Feb 1 2021, 10:02 PM

None of the menus are displaying which suggests to be that MediaWiki 1.35 was used to generate these screenshots.
While Example skin will work with 1.36, note it needs the full template data provided by 1.36 to work.

I'm not sure why styles are not displaying here from a screenshot. I'd need to see the payload and URL of all CSS assets requested in the network tab (please share the text not an image upload).

e.g. the text content of:
<your localhosthost>/w/load.php?lang=en-gb&modules=skins.example&only=styles&skin=example&debug=true

For what it's worth:
I ran into the same problem. The reason seems to be the following with load.php:

[c37b15c693d3a30d06ce5067] /mediawiki/load.php?lang=en&modules=ext.translate|ext.translate.tag.languages|ext.uls.pt|skins.example&only=styles&skin=example   InvalidArgumentException from line 145 of /path/to/mediawiki/includes/resourceloader/ResourceLoaderSkinModule.php: Feature `1` is not recognised
Backtrace:
#0 /path/to/mediawiki/includes/resourceloader/ResourceLoaderFileModule.php(397): ResourceLoaderSkinModule->getStyleFiles()
#1 /path/to/mediawiki/includes/resourceloader/ResourceLoaderSkinModule.php(170): ResourceLoaderFileModule->getStyles()
#2 /path/to/mediawiki/includes/resourceloader/ResourceLoaderModule.php(756): ResourceLoaderSkinModule->getStyles()
#3 /path/to/mediawiki/includes/resourceloader/ResourceLoaderModule.php(704): ResourceLoaderModule->buildContent()
#4 /path/to/mediawiki/includes/resourceloader/ResourceLoader.php(1191): ResourceLoaderModule->getModuleContent()
#5 /path/to/mediawiki/includes/resourceloader/ResourceLoader.php(899): ResourceLoader->makeModuleResponse()
#6 /path/to/mediawiki/load.php(51): ResourceLoader->respond()
#7 /path/to/mediawiki/load.php(38): wfLoadMain()
#8 {main}

Problematic modules: {"skins.example":"error"}
*/
[CSS follows]

I did some debugging, adding some more details around line 145 of includes/resourceloader/ResourceLoaderSkinModule.php:

if ( !isset( self::FEATURE_FILES[$feature] ) ) {
    $tmpstyles = print_r($styles, true);                                                                                                                                                               
    $tmpfeatures = print_r($this->features, true);
    throw new InvalidArgumentException( "Feature `$feature` is not recognised. styles = $tmpstyles, features = $tmpfeatures" );
}

The output suggests there is some mistake with parsing the skin.json file but at that point I gave up and updated to mediawiki 1.35.3 which solved this problem. But still the menu doesn't show up at all (as Jdlrobson mentioned). I just did a local update to 1.36 and now the menu is working. That's a bit sad because I'd prefer to have my production system run with the LTS version and still start using the new skin architecture but that's a different topic I guess...

The output suggests there is some mistake with parsing the skin.json file

Hey @Holybiber can you point me to some code that has that issue so I can help? I suspect the issue is in skin.json in how the features are declared. We supported arrays of features to begin with, but in 1.36 expanded it to allow object declarations. I suspect its a case of switching from array to object or vice versa.

but at that point I gave up and updated to mediawiki 1.35.3 which solved this problem. But still the menu doesn't show up at all (as Jdlrobson mentioned). I just did a local update to 1.36 and now the menu is working. That's a bit sad because I'd prefer to have my production system run with the LTS version and still start using the new skin architecture but that's a different topic I guess...

Have you seen the polyfill listed in https://www.mediawiki.org/wiki/Manual:How_to_make_a_MediaWiki_skin#Building_skins_for_1.35 ? That should support you making use of the new skin architecture for older versions. Let me know if you need any help, by sharing a github issue/phabricator ticket/other site bug tracker where I can help out.

Hey @Holybiber can you point me to some code that has that issue so I can help?

Hi @Jdlrobson, thanks for your comments! Well I didn't try anything more because it seemed this particular issue is solved with mediawiki 1.35.3

And I guess I'll now just go with mediawiki 1.36, that's fine and then all should work as expected.

I'd appreciate some remarks on the needed versions in the introduction of https://www.mediawiki.org/wiki/Manual:How_to_make_a_MediaWiki_skin

I had then tried everything with mediawiki 1.35.3 and the latest commit of Skin Example that still didn't require 1.36 (that requirement was apparently introduced some months ago) but still the menu didn't display at all.
So having a clear remark right at the beginning that version 1.36 is definitely necessary for the new way of skinning would be helpful.

And I don't know about @Nasirkhan but maybe that issue here could be closed then...

I'd appreciate some remarks on the needed versions in the introduction of https://www.mediawiki.org/wiki/Manual:How_to_make_a_MediaWiki_skin

I think https://www.mediawiki.org/wiki/Manual:SkinMustache.php contains the information you need for that. This is linked in several places on that page, but I've added to another section to make sure it's clearer.