Page MenuHomePhabricator

Content (including categories) not showing on file redirects
Closed, ResolvedPublic


Author: tomp2008

When adding any category to a redirect page in the File: namespace, the category name does not display in the page's bottom "Categories" box, although the page itself does get added to the category.

In the given example URL, the page is in [[Category:Test category]], and when you go to the category page "Category:Test category" it is there, but on the redirect page itself the category is not showing. ("Category:Test category" is a non-existent category but that doesn't matter, it's the same for any category).

To reproduce, simply: Go to any file redirect using [[Special:RandomRedirect/File]], and try adding a category to the page, either using Hotcat or by manually editing the page.

This was supposed to be fixed along with [[bugzilla:23851]] in the new 1.17 release but I guess it was overlooked.

Version: 1.17.x
Severity: minor
See Also:


Event Timeline

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

Created attachment 8247
patch to make article handle file redirects

Seems to be caused by ImagePage.php overriding Article.php without really any reason to. This patch seems to fix it, but I'm not sure whats really going on in Article.php or what consequences this might have or why code was duplicated between Article.php and ImagePage.php, so someone who knows whats going on should have a look.


rd232 wrote:

Renaming to clarify that the problem is not limited to categories: *no* content is displayed on file redirects.

rd232 wrote:

Additional: one use for file redirects is to allow transclusion of an "always-up-to-date" link. Basically, individual files should be stable: File:African borders 2011.jpg should always show the 2011 borders, etc. If people want to transclude a "current African borders" file, that should be a redirect: File:current African borders.jpg, which can be redirected to whatever the current file is for that series, so in 2012 it can be changed to point to File:African borders 2012.jpg, etc.

Now, ideally, a template on the redirect would explain matters, but because file redirects don't show any non-redirect content that's not possible at the moment.

sumanah wrote:

Brian, are you interested in submitting this into Gerrit?

(In reply to comment #4)

Brian, are you interested in submitting this into Gerrit?

Interesting, I did not recieve bug spam for this, and just happened to stumble upon this by accident.

Generally if I have a patch on a bug its because I think there's something wrong with my patch. I wrote this one over a year ago, so will have to re-look at it at some point.

As it has been a while, I have retested this, and it is still happening.

TheDJ added a subscriber: TheDJ.Jan 20 2016, 9:53 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 20 2016, 9:53 AM
TheDJ set Security to None.
TheDJ removed a subscriber: wikibugs-l-list.
Restricted Application added projects: Multimedia, Commons. · View Herald TranscriptJan 20 2016, 9:56 AM
Restricted Application added a subscriber: Steinsplitter. · View Herald Transcript
Restricted Application added a subscriber: Matanya. · View Herald TranscriptJan 20 2016, 9:57 AM
Steinsplitter moved this task from Incoming to Backlog on the Commons board.Jan 22 2016, 5:59 PM

Change 266582 had a related patch set uploaded (by TheDJ):
Add mw-content-ltr|rtl to file redirect pages

Jdforrester-WMF moved this task from Untriaged to Next up on the Multimedia board.Jul 7 2016, 2:10 PM

Change 334336 had a related patch set uploaded (by Matthias Mullie):
Display categories on File redirects

matthiasmullie moved this task from Next up to Needs code review on the Multimedia board.
matmarex closed this task as Resolved.Jul 4 2017, 4:09 PM
matmarex removed a project: Patch-For-Review.

Change 334336 merged by jenkins-bot:
[mediawiki/core@master] Display categories on File redirects