CatMembChange use timestamp from revision where possible
authoraddshore <addshorewiki@gmail.com>
Thu, 18 Feb 2016 10:45:04 +0000 (10:45 +0000)
committeraddshore <addshorewiki@gmail.com>
Thu, 18 Feb 2016 10:55:59 +0000 (10:55 +0000)
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

index 30906b8..1ff6f85 100644 (file)
@@ -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' ];
        }