Author: dunc_harris
[[special:randompage]] should not take users to disambiguation pages as they are not articles and not of interest.
Version: unspecified
Severity: enhancement
Author: dunc_harris
[[special:randompage]] should not take users to disambiguation pages as they are not articles and not of interest.
Version: unspecified
Severity: enhancement
robchur wrote:
To implement this in an efficient manner would require us marking disambiguation
pages as such in the page table.
robchur wrote:
(In reply to comment #2)
Thence the dependency on bug 6754. :)
Yes and no. Bug 6754 could be solved if we could cache the information somewhere
in the short term, but this pretty much mandates a definite schema change.
I'm not too fond of maintaining a disambiguation page's status in the page
record, to be honest; that a page is a "disambiguation page" depends on factors
outside of the page's control, so to speak, so it's a different kettle of fish
from, e.g. page.page_is_redirect.
ayg wrote:
(In reply to comment #3)
I'm not too fond of maintaining a disambiguation page's status in the page
record, to be honest; that a page is a "disambiguation page" depends on factors
outside of the page's control, so to speak, so it's a different kettle of fish
from, e.g. page.page_is_redirect.
It's similar to category links in that respect. Adding another template to the
list of disambig-creators would of course require all pages already including
that template to be fiddled with, which isn't good. However, I can't see
widely-used templates being changed to disambig templates very often except as
vandalism (and widely-used templates should be protected anyway). It would
probably be okay to just not bother changing the flag unless the page is touched.
This feature should be no harder to implement than simply using the same code as is used for the extant Special:DisambiguationPages and Special:DisambiguationPageLinks - use the same definition for disambiguation page as these use. You could even check the pag in real time, before returning it to the user.
Please make a user option to include dab pages in "random page" - some editors use "random page" to find pages needing work, including dab pages.
Actually this would not be trivial since RandomPage::getQueryInfo() only looks at the page table and there is no way to join the page_props table via the SpecialRandomGetRandomTitle hook. (Disambiguator works by adding an entry in the page_props table.) We would either need to significantly revise the hook or change RandomPage::getQueryInfo() to always join the page_props table (even when it isn't needed).
I don't agree with Swpb that we should create a new user option for opting out of this bug fix. Very few people actually want disambiguation pages from Special:Random. If editors really want to work on fixing disambiguation pages, there are plenty of ways to find them (categories and Special:DisambiguationPages).
or change RandomPage::getQueryInfo() to always join the page_props table (even when it isn't needed)
Special:RandomInCategory, however, should ideally not be affected.
The first step in solving this bug would be creating a new Hook in RandomPage::getQueryInfo() that allows extensions to modify the actual query that is used to choose a random page (rather than using the very limited SpecialRandomGetRandomTitle hook).
Change 231205 had a related patch set uploaded (by Kaldari):
Adding a new hook to allow modification of Special:Random query
Change 231207 had a related patch set uploaded (by Kaldari):
Modify the Special:Random query to ignore disambiguation pages
Change 231208 had a related patch set uploaded (by Kaldari):
Modify the Special:Random query to ignore disambiguation pages
Change 231207 abandoned by Kaldari:
Modify the Special:Random query to ignore disambiguation pages
Reason:
accidently created backport, not needed
Change 231205 merged by jenkins-bot:
Adding a new hook to allow modification of Special:Random query
The hook in core has been merged. If anyone wants to review the change in Disambiguator, it's https://gerrit.wikimedia.org/r/#/c/231208/.
Change 231208 merged by jenkins-bot:
Modify the Special:Random query to ignore disambiguation pages