Page MenuHomePhabricator

Commons __HIDDENCAT__ (change the default setting for logged-in users)
Closed, ResolvedPublic

Description

Author: test5555

Description:
Following the discussion at http://commons.wikimedia.org/w/index.php?title=Commons:Village_pump&oldid=36042358#Hidden_categories:_change_the_default_setting_for_logged-in_users
please change the default configuration for Commons to display "Hidden Categories" (categories marked with HIDDENCAT ) by default to all logged-in users. Users that don't want to view them may de-select this in User preferences.


Version: unspecified
Severity: enhancement

Details

Reference
bz22689

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:10 PM
bzimport set Reference to bz22689.
bzimport added a subscriber: Unknown Object (MLST).

ForoaW wrote:

Quite important for contributors to Commons.

(For reference, the preference in question is 'showhiddencats')

I'm unsure if this is a simple shell request. To make it be shown for everyone by default is easy - $wgDefaultUserOptions['showhiddencats'] = 1; However I don't think there is a config option to make it on by default for logged in users, and off by default for logged out users.

test5555 wrote:

I put the summary back to "Commons HIDDENCAT (change the default setting for logged-in users) " from "Have 'showhiddencats' option set to on by default for logged in users, but off for logged out users "

It might be easier to change the stylesheets at Commons for logged-in users and just display these categories.

test5555 wrote:

I left a note at [[Commons:MediaWiki_talk:Common.css#mw-hidden-cats-user-shown]]. That might be the better forum for this.

Setting

+'wgDefaultUserOptions' => array(
+ 'commonswiki' => array( 'showhiddencats' => true ),
+),

With true/1, we get

Global default '' is invalid for field math
Backtrace:
#0 /usr/local/apache/common-local/php-1.17/includes/Preferences.php(1154): Preferences::getPreferences(Object(User))
#1 /usr/local/apache/common-local/php-1.17/includes/specials/SpecialPreferences.php(70): Preferences::getFormObject(Object(User))
#2 /usr/local/apache/common-local/php-1.17/includes/SpecialPage.php(578): SpecialPreferences->execute(NULL)
#3 /usr/local/apache/common-local/php-1.17/includes/Wiki.php(251): SpecialPage::executePath(Object(Title))
#4 /usr/local/apache/common-local/php-1.17/includes/Wiki.php(63): MediaWiki->handleSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#5 /usr/local/apache/common-local/php-1.17/index.php(114): MediaWiki->performRequestForTitle(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
#6 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#7 {main}

which isn't much use....

Presumably that's overriding the entire array, which is unsetting all the other defaults, which causes problems. Most of the other code in InitialiseSettings.php seem to do $wmgSomething = 'blah'; and then in CommonSettings.php $wgDefaultUserOptions['something'] = $wmgSomething;

(In reply to comment #6)

Presumably that's overriding the entire array, which is unsetting all the other
defaults, which causes problems. Most of the other code in
InitialiseSettings.php seem to do $wmgSomething = 'blah'; and then in
CommonSettings.php $wgDefaultUserOptions['something'] = $wmgSomething;

<logmsgbot> !log reedy synchronized php-1.17/wmf-config/InitialiseSettings.php 'Testing showhiddencats for commons'
<morebots> Logged the message, Master
<logmsgbot> !log reedy synchronized php-1.17/wmf-config/CommonSettings.php 'Testing showhiddencats for commons'
<morebots> Logged the message, Master