Last modified: 2010-05-15 15:28:05 UTC
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.
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 [details] 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.
Created attachment 1288 [details] Updated patch Fixed special page / interwiki redirects, updated to current CVS HEAD.
Applied this stuff to head and put live. The test case URL now works.