Using Special:ListRequestedTopic
, the “Next 50” link at the bottom duplicates the query instead of just specifying an offset. For example, “ https://www.wikihow.com/Special:ListRequestedTopics?category=Computers+and+Electronics?category=Computers+and+Electronics&offset=50
”. It also occurs when doing a search by word. For example, “ https://www.wikihow.com/Special:ListRequestedTopics?st_search=linux&category=?st_search=linux&offset=50
”
I am using Chrome 87.0.4280.88 on both Linux and Windows 10, and encounter the problem in both. I have disabled any adblockers and custom JavaScript extensions. It was working a few days ago, so I believe this is a very recent change.
Not sure if this will totally solve the issue, but try setting your preferences to show 1000 recent changes instead of 50 so you can see more results instead of coming across this.
I’m seeing this too. Mozilla Firefox 83 (the latest version) on Windows 10 20H2 (also the latest version).
JayneG
4
Thanks for letting us know. I’ll report this, but because it’s likely pretty low priority, I’d recommend changing your preferences as Helpie mentioned for now
This is related to the extremely hacky, non-standard way of constructing the special page URL in the resultsHtml
function in /extensions/wikihow/suggestedtopics/ListRequestedTopics.body.php
(as of 2020-11-26), specifically related to the $nav_url
variable in that function.
Here’s the current code (as of 2020-11-26; only relevant lines of code are shown here; these are lines 192-212 as of 2020-11-26):
$nav_url = $_SERVER['SCRIPT_URI'];
if ($key)
$nav_url .= "?st_search=" . urlencode($key);
elseif ($category)
$nav_url .= "?category=" . urlencode($category);
if ($offset != 0) {
$pagination[] = [
'url' => $nav_url . "&offset=" . (max($offset - $limit, 0)),
'text' => ucfirst(wfMessage('previous')->text()),
'float' => 'left'
];
}
if ($count == $limit) {
$pagination[] = [
'url' => $nav_url . "&offset=" . ($offset + $limit),
'text' => ucfirst(wfMessage('next')->text()),
'float' => 'right'
];
}
Here’s a proposed solution to this issue, using native MediaWiki methods for constructing a special page URL (and also URL-encoding all the params etc. automagically); replace the aforementioned lines/chunks of code with this:
$pt = $this->getPageTitle();
$urlParams = [];
if ( $key ) {
$urlParams['st_search'] = $key;
} elseif ( $category ) {
$urlParams['category'] = $category;
}
if ($offset != 0) {
$pagination[] = [
'url' => $pt->getFullURL( array_merge( $urlParams, [ 'offset' => max( $offset - $limit, 0 ) ] ) ),
'text' => ucfirst(wfMessage('previous')->text()),
'float' => 'left'
];
}
if ($count == $limit) {
$pagination[] = [
'url' => $pt->getFullURL( array_merge( $urlParams, [ 'offset' => $offset + $limit ] ) ),
'text' => ucfirst(wfMessage('next')->text()),
'float' => 'right'
];
}
JayneG
6
Thanks for the possible solution, @Jack_Phoenix
- I’ll pass it along.