Page MenuHomePhabricator

Fatal exception in Special:Preferences when setting Minerva as the default skin
Closed, ResolvedPublic1 Story Points

Description

If you set $wgDefaultSkin = 'minerva'; in LocalSettings.php and visit Special:Preferences (when Beta features is not installed), you get a fatal "MWException from line 151 of includes/Preferences.php: Global default 'minerva' is invalid for field skin".

I checked $wgValidSkinNames inside a mid-execution hook and Minerva was included, I also checked $wgSkipSkins, Minerva wasn't there.

If instead you make Minerva the default skin by setting`$_GET['useskin'] = 'minerva';` directly in LocalSettings.php, the Preferences section works fine.

I'm using MediaWiki 1.27.0 and the corresponding MobileFrontend branch.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 22 2016, 2:31 PM
Sophivorus updated the task description. (Show Details)Jul 25 2016, 7:07 PM
Sophivorus renamed this task from Allow to make Minerva the default skin to Fatal exception in Special:Preferences when setting Minerva as the default skin.Jul 25 2016, 7:14 PM
Sophivorus updated the task description. (Show Details)
Jhernandez triaged this task as High priority.Jul 26 2016, 5:15 PM
Jhernandez moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.
Sophivorus updated the task description. (Show Details)Jul 28 2016, 1:51 AM

Change 306824 had a related patch set uploaded (by Jdlrobson):
Don't cause fatals on preferences page when default skin is Minerva

https://gerrit.wikimedia.org/r/306824

When I set $wgDefaultSkin = 'minerva'; in LocalSettings.php and visit Special:Preferences I see the page without an error. What else should I do to re-produce the error?

Add to your LocalSettings.php:

error_reporting( E_ALL );
ini_set( 'display_errors', 1 );
$wgShowSQLErrors = true;
$wgDebugDumpSql = true;
$wgShowDBErrorBacktrace = true;
//$wgDebugLogFile = "$IP/log";
$wgDebugComments = true;
$wgShowExceptionDetails = true;

No luck, I still see my preferences page.

You need to be using the desktop site when visiting the preferences page just in case that's not obvious.

I am using the desktop site:

I just downloaded the latest changes, disabled all other extensions and tried again, just in case, and I got an error, but for now it isn't a fatal exception, but a MWException. See screenshot attached.

@bmansurov Are you tracking the REL1_27 branch both in MediaWiki and MobileFrontend?

@lfschenone thanks. I tracked it down to BetaFeatures. Having wfLoadExtension( 'BetaFeatures' ); in LocalSettings.php masks the problem. I don't know why though.

The error I get is the same as reported by @lfschenone

The reason it works with BetaFeatures installed is that MobileFrontend registers a beta feature that makes this available as a desktop skin. The logic is broken. The patch I posted fixes exactly this.

Jdlrobson updated the task description. (Show Details)Aug 29 2016, 4:10 PM

If there any issues reviewing https://gerrit.wikimedia.org/r/#/c/306824/ please let me know.

@Jdlrobson can you clarify what you mean in the comment to the patch?

@bmansurov @jhobs: I've C+1ed @Jdlrobson's change. Could one or both of you look over it again?

Change 306824 merged by jenkins-bot:
Don't cause fatals on preferences page when default skin is Minerva

https://gerrit.wikimedia.org/r/306824

Change 307963 had a related patch set uploaded (by Phuedx):
Don't cause fatals on preferences page when default skin is Minerva

https://gerrit.wikimedia.org/r/307963

phuedx added a comment.Sep 1 2016, 3:52 PM

5b7be273 is a cherry-pick of 35a5db62 on the REL1_27 branch.

The patch has been merged.

Change 307963 merged by jenkins-bot:
Don't cause fatals on preferences page when default skin is Minerva

https://gerrit.wikimedia.org/r/307963

@Sophivorus: The fix has been backported to the REL1_27 branch of MobileFrontend. Do let us know if it works for you 🙂

phuedx reassigned this task from Jdlrobson to Sophivorus.Sep 5 2016, 10:42 AM
phuedx added a subscriber: Jdlrobson.
Sophivorus added a comment.EditedSep 5 2016, 12:08 PM

@phuedx I hate to bring bad news, but I'm afraid I'm getting the exact same error both in REL1_27 and in master (see screens attached). Am I doing something wrong? I pulled the latest changes on the core and the extension, both with REL1_27 and master, and disabled all other extensions, but still I get the error. What could be going on?

kaldari removed a subscriber: kaldari.Sep 6 2016, 7:57 PM

Hi @Sophivorus I just checked out REL1_27 for both MobileFrontend and mediawiki and I'm not seeing this issue with wgDefaultSkin = 'minerva'
When I go to Special:Version
I see: 1.27.1 (6045afb) for mediawiki and 1.0.0 (717861c) for MobileFrontend. What version numbers do you see?

If you see the same could you please paste all the extensions you have installed so I can debug further? Thanks!

@Jdlrobson I'm not sure what was wrong before, but now the error doesn't appear. I'm using 1.27.1 and 1.0.0

Issue solved. :-)

Thanks for getting back to us @Sophivorus I suspect it was a caching issue :) Glad it's fixed!

phuedx added a comment.Sep 7 2016, 8:07 AM

Thanks for following up on this @Jdlrobson and thanks for your time @Sophivorus.