Page MenuHomePhabricator

Exclude disambiguation pages from random page feature
Closed, ResolvedPublic

Description

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

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:23 PM
bzimport set Reference to bz7937.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

To implement this in an efficient manner would require us marking disambiguation
pages as such in the page table.

ayg wrote:

Thence the dependency on bug 6754. :)

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.

Changing product/component: Should be doable with the Disambiguator extension now.

jayvdb changed the task status from Open to Stalled.Jan 30 2015, 12:15 PM
jayvdb raised the priority of this task from Low to Needs Triage.
jayvdb set Security to None.
Aklapper triaged this task as Lowest priority.Mar 23 2015, 5:26 PM
Aklapper added a subscriber: Aklapper.
Nemo_bis changed the task status from Stalled to Open.Mar 23 2015, 7:42 PM

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

https://gerrit.wikimedia.org/r/231205

Change 231207 had a related patch set uploaded (by Kaldari):
Modify the Special:Random query to ignore disambiguation pages

https://gerrit.wikimedia.org/r/231207

Change 231208 had a related patch set uploaded (by Kaldari):
Modify the Special:Random query to ignore disambiguation pages

https://gerrit.wikimedia.org/r/231208

Change 231207 abandoned by Kaldari:
Modify the Special:Random query to ignore disambiguation pages

Reason:
accidently created backport, not needed

https://gerrit.wikimedia.org/r/231207

Change 231205 merged by jenkins-bot:
Adding a new hook to allow modification of Special:Random query

https://gerrit.wikimedia.org/r/231205

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

https://gerrit.wikimedia.org/r/231208

kaldari claimed this task.

This bug is now resolved. Sorry for the wait (9 years) :-)