Page MenuHomePhabricator

Fatal exception in Special:Preferences when setting Minerva as the default skin
Closed, ResolvedPublic1 Estimated 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

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)

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 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?

Screen Shot 2016-08-26 at 11.00.13 AM.png (800×1 px, 235 KB)

@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 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

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 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?

Screen Shot 2016-09-05 at 9.05.53 AM.png (800×1 px, 213 KB)

Screen Shot 2016-09-05 at 9.01.47 AM.png (800×1 px, 235 KB)

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!

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