Page MenuHomePhabricator

Redirect to category page doesn't work
Closed, ResolvedPublic

Description

Author: svdb+mediazilla

Description:
'#REDIRECT [[:Category:Some_Category]]' does not work.


Version: 1.5.x
Severity: normal

Details

Reference
bz710

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 7:07 PM
bzimport set Reference to bz710.

svdb+mediazilla wrote:

The page redirected to shows up now, but not the articles in it.
Compare [[:Category:Disambiguation]] (some random category I redirected to) on the test wiki to [[Redirect_to_category]].

Well done :o) We have to change the namespace of the article
object when we follow a redirect.

Removing fixed-in-cvs keyword, since this still fails in 1.4.

Just tested on test.wikipedia.org: the image redirect behaviour is still broken
as described in Bug #1103.

  • Bug 1158 has been marked as a duplicate of this bug. ***

kdkeck wrote:

*** Bug 100 has been marked as a duplicate of this bug. ***

egil wrote:

Redirect of categories works per se, both with and without the initial colon.

But when you get to the redirected article itself, the category list does not
appear.

  • Bug 1476 has been marked as a duplicate of this bug. ***

plugwash wrote:

Bug 1476 is NOT a duplicate of this one.

test.wikipedia.org seems to have dissapeared!

i have set up a series of test pages on the commons (since that seems to be the
wiki that needs redirects to categories most) to gauge the current status of
this issue.

http://commons.wikimedia.org/wiki/Testredirectpagetopage (works fine)
http://commons.wikimedia.org/wiki/Testredirectpagetocat (shows title section of
category but not contents)
http://commons.wikimedia.org/wiki/Testredirectpagetoimage (shows image
description but the image itself image links or image history)

http://commons.wikimedia.org/wiki/Image:Testredirectimagetopage (works fine)
http://commons.wikimedia.org/wiki/Image:Testredirectimagetocat (shows title
section of category but not contents)
http://commons.wikimedia.org/wiki/Image:Testredirectimagetoimage (shows image
discription and image links section works but the image itself and the image
history are not there)

http://commons.wikimedia.org/wiki/Category:Testredirectcattopage (works fine)
http://commons.wikimedia.org/wiki/Category:Testredirectcattocat (works fine)
http://commons.wikimedia.org/wiki/Testredirectpagetoimage (shows image
description but the image itself image links or image history)

so it seems that right now we can redirect from anything to a page and from a
category to a category and it will work right but everything else is broken.

Aphaia wrote:

well, if a category:YY contains "#redirect[[:Category:XX]] "can work and we
reach the target category, but there the page tagged with category:YY cannot be
listed in Category:XX, so redirection itself don't solve the problem perfectly
imo. I wonder we could get the tagged with the former category in the latter
category too, or it is not feasible.

richholton wrote:

(In reply to comment #11)
It's technologically feasible. Whether it's practical is another question...

Just to clarify: if a user navigates directly to Category:XX, then only pages in
category XX would be listed, but if a user navigates to Category:YY and is
redirected to Category:XX, pages in either category are displayed. Or would you
always want pages in either category displayed, regarless of how one navigates
there? The former sounds potentially confusing to the user. The latter could get
crazy.

I had thought a bit about a "Merge Category" special page, but this would
require actual changes to the text of pages where the category name is changed

  • something I think we want to stay away from.

mediawiki-bugzilla wrote:

This change works for me:
diff Article.php.orig Article.php
389c389
< if ( $rt->getNamespace() ==

NS_SPECIAL ) {

if ( $rt->getNamespace() !=

$this->mNamespace ) {

back around, will try to have a close look at this
old bug ( see #100 as well :p ).

  • Bug 2945 has been marked as a duplicate of this bug. ***

I commited a patch for index.php that check if the page redirect
to something and if so fix the namespace if it's different.
Seems to solve the issue with redirect from main namespace to a
category page.

Still have to fix it when a page redirect to an image (image
is actually not showing).

mr.primus wrote:

'#REDIRECT [[:Category:Some_Category]]' from an article to a category redirects
to the right page, but entries of this category are missing. With a click on
register category on this page you get the entries.

(In reply to comment #18)

'#REDIRECT [[:Category:Some_Category]]' from an article to a category redirects
to the right page, but entries of this category are missing. With a click on
register category on this page you get the entries.

And it's fixed in cvs. Not sure if I should commit it back to 1.5.

It'd be nice to have. We make heavy use of categories for their convenience, and
would like to redirect (eg) Conventions to Category:Conventions so we don't have
to type out [[:Category:Conventions|conventions]] all the time, but we can't do
that until the fix is in.

fabian wrote:

We use this too heavily. Why don't you want to commit it back?

enigmatic wrote:

Another issue relating to this. Not only does redirecting from an Article to a Category not display the list of
sub-categories, but if there is a discussion page associated with the category it is not showing up. I believe
that while the redirect occurred, it still thinks it is back at the previous article (and that previous article
didn't have a discussion).

This would then make sense, as the engine believes it is rendering an article (after all that was the type of
page being loaded), but once redirected it does not need to list any sub-categories because it is still under
the assumption its the "original" article it is rendering (despite the content being that of the destination).

cheezel wrote:

Is there an update on the status of this bug?

cheezel wrote:

It seems to be working fine in wikipedia.org, however my mediawiki site v1.5.0
does not seem to work.

see working at wikipedia.org
http://en.wikipedia.org/w/index.php?title=Flamenco_singers&redirect=no
http://en.wikipedia.org/wiki/Flamenco_singers

cheezel wrote:

It seems to be working fine in wikipedia.org, however my mediawiki site v1.5.0
does not seem to work.

see working at wikipedia.org
http://en.wikipedia.org/w/index.php?title=Flamenco_singers&redirect=no
http://en.wikipedia.org/wiki/Flamenco_singers

plugwash wrote:

iirc its fixed in current cvs and on the wikimedia sites but not in the 1.5.x
branch atm i dunno if they are going to bother backporting it or not.

csieber wrote:

Let's assume I am fairly new at MediaWiki administration, but that we need the
display of subcategories on redirect. What files should I get from CVS and
replace in my install to fix this?

cheezel wrote:

I got it to work by replacing index.php with version 1.101 from the CVS repository.
It doesn't seem to have broken anything else.....yet.

http://www.wikipubs.com

thibault.stephane wrote:

Just reporting that I installed a personal wiki with the 1.5.4 version and I still experience the same problem more than 2 months after the last post. But it was the holidays so... : )

gangleri wrote:

Hallo!

The actual summary of this bug relates to "categories" only:
Bug 710: Redirect to category page doesn't work

However the actual "Blocks" list of this bug contains:
Bug 786: Redirect on an image description page redirects, but the target page
displays the image
Bug 1103: When redirecting to an image description page, the redirect works but
the image is not show.

There is also
Bug 709: Cannot rename/move images and other media files.
and
Bug 4470: Need to refer to a single image using multiple names

Please readjust dependencies. Thanks in advance!

best regards reinhardt [[user:gangleri]]

dan wrote:

(In reply to comment #27)

Let's assume I am fairly new at MediaWiki administration, but that we need the
display of subcategories on redirect. What files should I get from CVS and
replace in my install to fix this?

I'm in the same boat, but moreso -- how do I get files from the CVS?

dan wrote:

(In reply to comment #27)

Let's assume I am fairly new at MediaWiki administration, but that we need the
display of subcategories on redirect. What files should I get from CVS and
replace in my install to fix this?

I'm in the same boat, but moreso -- how do I get files from the CVS?

robchur wrote:

(In reply to comment #32)

I'm in the same boat, but moreso -- how do I get files from the CVS?

http://www.mediawiki.org/wiki/Download_from_CVS

brianna.laugher wrote:

Is this completely fixed? Doing a category RDR to a category works as far as the
link goes, but an image in the bad category doesn't appear in the better one. I
put [[commons:Image:Example.jpg]] in [[:commons:Category:Badcategoryname]],
then tried to make it a RDR to [[:commons:Category:Goodcategoryname]]. Should we
just stick to {{category redirect}}?

beland wrote:

Specifically, that's Bug 3311: Automatic category redirects

  • Bug 5226 has been marked as a duplicate of this bug. ***