Fixed regression from 97b2a1dfd with URL specified edit tags
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 25 May 2015 18:29:34 +0000 (11:29 -0700)
committerOri.livneh <ori@wikimedia.org>
Tue, 26 May 2015 02:44:10 +0000 (02:44 +0000)
Bug: T100248
Change-Id: I2688356cd5f628dca395d1caaa82b9a5b21c025e

includes/EditPage.php

index b0da562..e88baaf 100644 (file)
@@ -1958,11 +1958,13 @@ class EditPage {
 
                if ( $this->changeTags && isset( $doEditStatus->value['revision'] ) ) {
                        // If a revision was created, apply any change tags that were requested
-                       ChangeTags::addTags(
-                               $this->changeTags,
-                               isset( $doEditStatus->value['rc'] ) ? $doEditStatus->value['rc']->mAttribs['rc_id'] : null,
-                               $doEditStatus->value['revision']->getId()
-                       );
+                       $addTags = $this->changeTags;
+                       $revId = $doEditStatus->value['revision']->getId();
+                       // Defer this both for performance and so that addTags() sees the rc_id
+                       // since the recentchange entry addition is deferred first (bug T100248)
+                       DeferredUpdates::addCallableUpdate( function() use ( $addTags, $revId ) {
+                               ChangeTags::addTags( $addTags, null, $revId );
+                       } );
                }
 
                return $status;