From 69566788e0dee901a6db9d5435e67b052f75f7c6 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 18 Feb 2016 10:45:04 +0000 Subject: [PATCH] CatMembChange use timestamp from revision where possible This should mean that where possible the timestamp for the category membership change will be equal to that of the time of the revision that caused the change. The IDs still may have space between them. Bug: T126048 Change-Id: Ia270451ccb02f2fca979ccb1fcefa5bdb4a96722 --- includes/changes/CategoryMembershipChange.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/changes/CategoryMembershipChange.php b/includes/changes/CategoryMembershipChange.php index 30906b82ad..1ff6f85237 100644 --- a/includes/changes/CategoryMembershipChange.php +++ b/includes/changes/CategoryMembershipChange.php @@ -65,7 +65,11 @@ class CategoryMembershipChange { */ public function __construct( Title $pageTitle, Revision $revision = null ) { $this->pageTitle = $pageTitle; - $this->timestamp = wfTimestampNow(); + if ( $revision === null ) { + $this->timestamp = wfTimestampNow(); + } else { + $this->timestamp = $revision->getTimestamp(); + } $this->revision = $revision; $this->newForCategorizationCallback = [ 'RecentChange', 'newForCategorization' ]; } -- 2.20.1