jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362322 )

Change subject: Revision-Create: Populate the rev_content_changed field.
......................................................................


Revision-Create: Populate the rev_content_changed field.

Change-Id: Ibd32ceb99bc650e3927c1bde28c05d0145fc205b
Depends-On: Ia5492563e8e88b60eba49eccf603b1599c6c3a74
---
M EventBus.php
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Mobrovac: Looks good to me, approved
  Ottomata: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/EventBus.php b/EventBus.php
index 059d620..fa7c8cb 100644
--- a/EventBus.php
+++ b/EventBus.php
@@ -224,8 +224,16 @@
                // must have a minimum value of 1, so omit it entirely when 
there is no
                // parent revision (i.e. page creation).
                $parentId = $revision->getParentId();
+               // Assume that the content have changed by default
+               $attrs['rev_content_changed'] = true;
                if ( !is_null( $parentId ) ) {
                        $attrs['rev_parent_id'] = $parentId;
+                       if ( $parentId !== 0 ) {
+                               $parentRev = Revision::newFromId( $parentId );
+                               if ( !is_null( $parentRev ) ) {
+                                       $attrs['rev_content_changed'] = 
$parentRev->getSha1() !== $revision->getSha1();
+                               }
+                       }
                }
 
                return $attrs;

-- 
To view, visit https://gerrit.wikimedia.org/r/362322
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd32ceb99bc650e3927c1bde28c05d0145fc205b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventBus
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to