Page MenuHomePhabricator

When redirecting to an image description page, the redirect works but the image is not show.
Closed, ResolvedPublic

Description

When redirecting to an image description page, the redirect works but the image
is not show. That is, the resulting page shows the description page that is the
target of the redirect, but it does not show the image. Also, the list of pages
using the image is missing.

The same is also true if the page containing the redirect is itself an image
page. In this case, however, a list of pages using the images is shown, but the
*wrong* one, namely the usage-list for the image who's description page contains
the redirect. This is extremely confusing.

Redirects from one image description page to another may seem a bad thing at
first, but they do make sense in some cases, especially when an image was moved
(by re-uploadin it) to a different name. In such a case it would be useful to
have a redirect on the old description page (but no image associated with it!),
so that external links are not broken and the image is still found by google.
This is especially needed when an image is moved to the commons under a
different name and the local copy is deleted. In that case, the description page
(not the image) should be present under the old name, redirecting to the local
description page under the new name.

I guess this is an effect of the same bug that causes #786: the image name is
determined from the query-url *before* the redirect is resolved. But the
*effective* page name should be used to find the image file.


Version: 1.3.x
Severity: normal
URL: http://de.wikipedia.org/w/wiki.phtml?title=Bild:Gnu-head.png

Details

Reference
bz1103

Event Timeline

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

This is the same basic problem as with categories (bug 710); the redirect doesn't
start over fresh with a new Article (or subclass) instance, but hacks some of the
data in the current one.

Created attachment 1286
Patches to current CVS moving redirect handling up a level

I want this a little more tested and shaken out before committing. It moves the
handling of redirects out of Article::fetchContent()/getContent(), making it
the responsibility of the caller (eg Wiki.php) to check and create an Article
object of the appropriate class.

Seems to handle redirects to image and category pages correctly, but there
could be surprises.

Also this might be making unnecessary text content loads.

attachment redirect-handling.diff ignored as obsolete

Created attachment 1288
Updated patch

Fixed special page / interwiki redirects, updated to current CVS HEAD.

Attached:

Applied this stuff to head and put live. The test case URL now works.