From dda7a2c3ed148e7294dd622cec71498b3a44a08d Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 11 Jul 2019 15:59:56 +1000 Subject: [PATCH] Some fixes to page updater docs A couple of typos, and also remove a thing that says isDeleted() should be skipped for the current revision -- isDeleted() does not do a DB query so there's no performance rationale for spreading assumptions and increasing complexity in that way. Change-Id: I661a6889618f188a9aa72f2f9a2c2ebf69ba09c4 --- docs/pageupdater.txt | 4 ++-- includes/Storage/DerivedPageDataUpdater.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/pageupdater.txt b/docs/pageupdater.txt index 54eb91a9e5..fd084c0587 100644 --- a/docs/pageupdater.txt +++ b/docs/pageupdater.txt @@ -161,11 +161,11 @@ Calling prepareUpdate() with the same parameters again has no effect. Calling it again with mismatching parameters, or calling it with parameters mismatching the ones prepareContent() was called with, triggers a LogicException. -- getSecondaryDataUpdtes() returns DataUpdates that represent derived data for the revision. +- getSecondaryDataUpdates() returns DataUpdates that represent derived data for the revision. These may be used to update such data, e.g. in ApiPurge, RefreshLinksJob, and the refreshLinks script. -- doUpdates() triggers the updates defined by getSecondaryDataUpdtes(), and also causes +- doUpdates() triggers the updates defined by getSecondaryDataUpdates(), and also causes updates to cached artifacts in the ParserCache, the CDN layer, etc. This is primarily used by PageUpdater, but also by PageArchive during undeletion, and when importing revisions from XML. doUpdates() can only be called after prepareUpdate() was used to diff --git a/includes/Storage/DerivedPageDataUpdater.php b/includes/Storage/DerivedPageDataUpdater.php index b4d6f052f6..6f7577381d 100644 --- a/includes/Storage/DerivedPageDataUpdater.php +++ b/includes/Storage/DerivedPageDataUpdater.php @@ -79,7 +79,7 @@ use WikiPage; * * DerivedPageDataUpdater instances are designed to be cached inside a WikiPage instance, * and re-used by callback code over the course of an update operation. It's a stepping stone - * one the way to a more complete refactoring of WikiPage. + * on the way to a more complete refactoring of WikiPage. * * When using a DerivedPageDataUpdater, the following life cycle must be observed: * grabCurrentRevision (optional), prepareContent (optional), prepareUpdate (required @@ -580,7 +580,6 @@ class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface { */ public function isContentDeleted() { if ( $this->revision ) { - // XXX: if that revision is the current revision, this should be skipped return $this->revision->isDeleted( RevisionRecord::DELETED_TEXT ); } else { // If the content has not been saved yet, it cannot have been deleted yet. -- 2.20.1