Last modified: 2011-07-16 02:29:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31722, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29722 - WikiLove should follow redirects
WikiLove should follow redirects
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
WikiLove (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Ryan Kaldari
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-05 19:39 UTC by Krinkle
Modified: 2011-07-16 02:29 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2011-07-05 19:39:32 UTC
Reported on mediawiki.org:

----------

Source: http://mediawiki.org/wiki/Thread:Talk:WikiLove/WikiLove_templates_do_not_obey_redirect_syntax
From: TeleComNasSprVen
Date: 15:09, 5 July 2011 (UTC)
Report summary:

If User_talk:Foo redirects to User_talk:Bar, WikiLove templates and messages are still automatically deployed directly underneath the #REDIRECT [[User_talk:Bar]] string, which can give a headache for trying to show wikilove to recently renamed users and cluttering up Special:WhatLinksHere, among other issues.
Comment 1 Ryan Kaldari 2011-07-13 23:40:41 UTC
Maybe we could add some kind of check for the redirect...

if ( strstr( $page, '#REDIRECT' ) ) {
   $pattern = '/#REDIRECT\s*\[\[(.*)\]\]/i';
   $tester = preg_match( $pattern, $page, $matches );
   $talkPageTitle = $matches[1];
}

(might need to be in javascript though depending on if we're doing it client-side or server-side)
Comment 2 Roan Kattouw 2011-07-15 01:44:20 UTC
(In reply to comment #1)
> Maybe we could add some kind of check for the redirect...
> 
> if ( strstr( $page, '#REDIRECT' ) ) {
>    $pattern = '/#REDIRECT\s*\[\[(.*)\]\]/i';
>    $tester = preg_match( $pattern, $page, $matches );
>    $talkPageTitle = $matches[1];
> }
> 
Nooooo! There are better ways to check for this, don't reinvent the wheel. There's Article::getRedirectTarget() (technically in the WikiPage class in trunk) on the PHP side, and an API call for this on the JS side.
Comment 3 Ryan Kaldari 2011-07-16 02:29:08 UTC
Actually it looks like this is not a good idea for 2 reasons. First it can lead to an endless loop:

1. User talk:John redirects to User:John
2. WikiLove retrieves the user page for User:John which is User talk:John
3. Goto 1

1. User talk:John redirects to User talk:John/subpage
2. WikiLove retrieves the base page title for User talk:John/subpage which is User talk:John
3. Goto 1

Secondly, I think it would be confusing for someone on User:John to be redirected to User talk:Willy after they submit their WikiLove on User:John. I imagine they would think that an error had occurred.

I've worked around this problem in r92344. The WikiLove tab is now only displayed on User pages that have real talk pages (not redirects). This means the user has to follow the redirect on their own, which should eliminate any confusion.

Marking WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links