Page MenuHomePhabricator

Replace Title parameters with PageIdentity (straight forward cases)
Open, HighPublic

Description

As a first step of moving the code base away from Title, towards PageIdentity, we need to make methods that currently expect a Title instance accept a PageIdentity instance instead. This is generally safe, since every Title is a PageIdentity, so callers do not need to change. Ideally, the implementation of the method will work directly on the PageIdentity, but converting back to a Title is acceptable (via an injected TitleFactory, or the static cast method on Title).

NOTE: Methods that are stable to override (explicitly or implicitly because they are abstract on a class that is stable to extend) cannot be changed in this way!

The idea is that we can convert more code to not use Title when we have more interfaces that do not require Title. So the strategy is to work from the public interfaces inward.

Straight forwards cases (presumably - always check for pitfalls):

Known hard cases that need further investigation (please link tickets where appropriate):

  • Parser, ParserOutput, ParserOptions, PPFrame and friends
  • Remaining parts of RevisionStore
  • Content, ContentHandler (stable to override)
  • PrefixSearch (stable to override)
  • SearchResult and subclasses
  • ...

Event Timeline

Change 678013 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] Remove Title from public interface of OutputPage

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

Change 678045 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] WIP: Remove Title from method signatures in User

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

Change 678252 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] HTMLFileCache: replace Title in method signatures

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

Change 678253 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] WikiExporter: replace Title in method signatures

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

Change 678267 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] RepoGroup: replace Title in method signatures

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

Change 678274 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] FileRepo: replace Title in method signatures

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

Change 678279 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] RecentChange: replace Title in method signatures

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

daniel triaged this task as High priority.Fri, Apr 9, 5:33 PM
daniel updated the task description. (Show Details)