Page MenuHomePhabricator

cleaner array for avoiding Special:Specialpages' disabled links
Closed, DeclinedPublic


On Special:Specialpages there are several items that if a user clicks
on, e.g., Special:Upload, he will be in for a big disappointment: only
to learn that that functionality has been turned off for the website
in question.

Well, as these items are controlled by global variables set in
LocalSettings.php, they should be detected upon producing the links
for Special:Specialpages, so links that will merely lead to certain
disappointment should not be offered in the first place!

Tell the customer at the door that there is no more food. Don't wait
until he sits down and starts reading the menu.

Version: 1.15.x
Severity: trivial



Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:52 PM
bzimport set Reference to bz11023.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

The specific case of Special:Upload is dealt with in r25047, although I should point out that being notified that uploads are disabled is *useful* for new wiki owners who don't realise that uploads aren't enabled per default, so this might be reverted.

Most other cases seem to be handled; Special:Popularpages is disabled if page counters are disabled, Special:Search is disabled when internal search is, and Special:Confirmemail is disabled if email authentication is not required.

Reverted in r25058 -- harms usability for no reason.

Today I even had a telephone call from a user who clicked
Special:upload only to be told that sorry, uploads are disabled.

Why not use <del> or <strike> on Special:Specialpages,
instead of having the user click to find out something you already know?

Indeed you could remove the <a href> and still show the linkname also.

Don't many menu software show disabled items in grey?
That way one knows in advance to not bother to click on them.

Patch to add a clean way to do exclusions.

Also checking $wgUseDatabaseMessages before giving 'Allmessages'. Feel free to comment out, like
#$wgEnableUploads => 'Upload', // r25058

Created attachment 5942
cleaner array method

attachment SpecialsGeneralExcluder ignored as obsolete

Comment on attachment 5942
cleaner array method

OOPS BLEW IT. New patch in a moment.

Backing out. Each item needs to be changed in three places. Too hard to maintain as you see from me forgetting to change the Uploads one.

Feel free to check $wgUseDatabaseMessages before giving 'Allmessages' one day...

To anyone reading this bug, here's how I finally got "rid" of those Special Pages that bother me. In LocalSetting.php I used:

function JidanniLessSpecialPages(&$list){foreach(array('Uncategorizedimages','Unusedimages','Withoutinterwiki','Upload',
'Ipblocklist')as $i){unset($list[$i]);}return true;}