Page MenuHomePhabricator

Database Query error from Special:IPContributions in archive mode when 'latest' is checked
Closed, ResolvedPublic

Description

Background

Special:IPContributions is used for searching contributions from temporary accounts using a given IP (or range). In normal mode, it searches the revision table for existing revisions, and in archive mode it searches the archive table for revisions of articles that have been deleted.

The page has a form with search filters, which is the same as the search form in Special:Contributions (see T363358).

One of the search filters is a checkbox: 'Only show edits that are latest revisions'. this checkbox makes no sense for archive mode, since the article was deleted. It should be removed.

Searching with 'Only show edits that are latest revisions' checked encounters a database query error:

Error 1054: Unknown column 'page_latest' in 'where clause'
Technical notes

The queries for SpecialIPContributions are built in IPContributionsPager::getRevisionQuery. The query for the revision table joins on the page table, and selects the page_latest field.

The query for the archive table cannot join on the page table, because the page has been deleted. Therefore there is no page_latest field; hence the error.

SpecialIPContributions extends ContributionsSpecialPage, which builds the form and supports normal/archive modes.

What needs doing

The 'Only show edits that are latest revisions' checkbox should not be added to the search form built by ContributionsSpecialPage in archive mode.

Event Timeline

Change #1058610 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] Don't show 'latest' field in archive mode on contributions search form

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

Change #1058620 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/CheckUser@master] Override isArchive method in SpecialIPContributions

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

Change #1058620 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Override isArchive method in SpecialIPContributions

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

Change #1058610 merged by jenkins-bot:

[mediawiki/core@master] Don't show 'latest' field in archive mode on contributions search form

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

Djackson-ctr subscribed.

I have verified the new code has been implemented and displaying as expected.

image.png (1,174×879 px, 77 KB)