Page MenuHomePhabricator

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

Description

Author: tomp2008

Description:
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
URL: http://en.wikipedia.org/w/index.php?title=File:Covernt1.jpg&redirect=no
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=23851

Details

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.

Attached:

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.

Restricted Application added a subscriber: Steinsplitter. · View Herald Transcript

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

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

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

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

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

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