Wikimedia
Make MediaWiki's Special:Redirect page redirect to log events by ID
MediaWiki has a special page, Special:Redirect, which allows users to view the page, revision, or user associated with a particular ID. Your task is to add functionality which redirects users to a log entry according to the log ID.
Here is one possible way to implement this:
- Query the database for all log entries with the same timestamp as the requested log entry. (This can be done using nested SELECT queries. As this is a fairly advanced database query, I will help you with it.)
- If no log entries are returned, display an error.
- If there is more than one log entry, narrow them down based on
log_type
first, thenlog_action
, thenlog_user
, thenlog_namespace
andlog_title
, as far as is required until there is only one log entry remaining. - Display that log entry (or log entries, if more than one) to the user by redirecting them to Special:Log with the necessary URL parameters.
The database schema for the logging
table can be viewed at MediaWiki.org.
More details at https://phabricator.wikimedia.org/T71107. (Another user uploaded a patch to that task in 2014, but their implementation is poor. In particular, it prevents paging to nearby log entries, which is often very important. You should start from scratch.)
Task tags
Students who completed this task
Pranav Kumar