Last modified: 2013-04-22 16:14:30 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 T45384, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43384 - Invalid link construction from the watchlist to [[Special:ArticleFeedbackv5Watchlist]]
Invalid link construction from the watchlist to [[Special:ArticleFeedbackv5Wa...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
ArticleFeedbackv5 (Other open bugs)
master
All All
: Normal trivial (vote)
: ---
Assigned To: Dereckson
: javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-24 16:35 UTC by Dereckson
Modified: 2013-04-22 16:14 UTC (History)
2 users (show)

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


Attachments

Description Dereckson 2012-12-24 16:35:46 UTC
From the watchlist, there is a link "Feedback from my watched pages »" to go to [[Special:ArticleFeedbackv5Watchlist]].

This link has an hardcore appended ?ref=watchlist.

In a wiki with default URL configuration leading to a {$wgScript}?title=$1 article path, the target link is wrong.

[ Current behavior ]

The link leads to /w/index.php?title=Special:ArticleFeedbackv5Watchlist?ref=watchlist

As the [[Special:ArticleFeedbackv5Watchlist?ref=watchlist]] doesn't exist, it will lead to 404: "You have requested an invalid special page. A list of valid special pages can be found at Special pages."

[ Expected behavior ]

Expected link: /w/index.php?title=Special:ArticleFeedbackv5Watchlist&ref=watchlist
Comment 1 Dereckson 2012-12-24 16:45:24 UTC
[ Adding javascript keyword, the link being built in JS ]

Relevant code:

                // Build the url to the Special:ArticleFeedbackv5 page
                var params = { ref: 'watchlist' };
                var url = mw.config.get( 'wgArticleFeedbackv5SpecialWatchlistUrl' ) +
                        '?' + $.param( params );
Comment 2 Jesús Martínez Novo (Ciencia Al Poder) 2012-12-24 17:12:39 UTC
Currently on en.wp, wgArticleFeedbackv5SpecialWatchlistUrl is "/wiki/Special:ArticleFeedbackv5Watchlist". This is a very bad decision.

It should be "Special:ArticleFeedbackv5Watchlist" instead, so one can construct the URL with:

 mw.config.get('wgScript') + '?title=' +  mw.config.get('wgArticleFeedbackv5SpecialWatchlistUrl') + '&' + $.param( params );

And for the plain URL to the special page, without params:

 wgArticlePath.replace('$1', mw.config.get('wgArticleFeedbackv5SpecialWatchlistUrl'));
Comment 3 Dereckson 2012-12-24 17:20:56 UTC
You're right Jesús, I agree with your recommendation.

Meanwhile, I prepared Gerrit change #40324 for a quick fix, but I would prefer your solution to be implemented, I'm cloning the bug appropriately.
Comment 4 Dereckson 2012-12-24 17:25:08 UTC
Well... I made a search, wgArticleFeedbackv5SpecialWatchlistUrl is only used to build this link and nothing else, so I guess it's safe I directly prepare an alternative patch instead implementing your solution.
Comment 5 Dereckson 2012-12-24 17:59:47 UTC
Quick fix merged.

For reference, I opened Gerrit change #40327 for the more elegant solution offered by Jesús.

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


Navigation
Links