Page MenuHomePhabricator

Rename EditResult::isNullEdit()
Open, MediumPublic

Description

The semantics of EditResult::isNullEdit() do not match the definition of a null edit given in https://www.mediawiki.org/wiki/Manual:Purge#Null_edits. It will also return true for null (dummy) revisions (see https://www.mediawiki.org/wiki/Manual:Null_revision). Indeed covering dummy revisions appears to be the original intent.

The method is used fairly widely in extensions and skins, and it's not immediately clear what the expected semantics are in each use case. To avoid further confusion, EditResult should use the same terminology as PageRevisionUpdatedEvent:

  • changedLatestRevisionId() returns true for null edits but not for dummy revisions.
  • isEffectiveContentChange() returns false for both null edits and dummy revisions.
  • isNominalContentChange() returns false for dummy revisions but true for null edits.

The isNullEdit method should be deprecated and replaced by the three methods above. Ideally, callers would use PageRevisionUpdatedEvent for this information, but that requires all handlers for the PageSaveCompleteHook to be converted to listeners for PageRevisionUpdatedEvent.

Event Timeline

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

[mediawiki/core@master] Storage: Clarify semantics of EditResult::isNullEdit

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

Change #1137508 merged by jenkins-bot:

[mediawiki/core@master] Storage: Clarify semantics of EditResult::isNullEdit

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

aaron triaged this task as Medium priority.Mar 17 2026, 5:34 AM