jenkins-bot has submitted this change and it was merged.

Change subject: Formatter Fix for related Echo change
......................................................................


Formatter Fix for related Echo change

Related: I42f4d7566543332588431c21c220c0d64d026b70

Change-Id: I5dc82a66f3aa289da1ff1a2f1ccd2db548b6bb66
---
M includes/Notifications/Formatter.php
1 file changed, 7 insertions(+), 1 deletion(-)

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

Objections:
  Jdlrobson: There's a problem with this change, please improve



diff --git a/includes/Notifications/Formatter.php 
b/includes/Notifications/Formatter.php
index 93ff1ff..02d99b9 100644
--- a/includes/Notifications/Formatter.php
+++ b/includes/Notifications/Formatter.php
@@ -158,7 +158,13 @@
        protected function getFirstUnreadPostId( $event, $user ) {
                $data = $this->getBundleLastRawData( $event, $user );
                if ( $data ) {
-                       $extra = $data->event_extra;
+                       // Remove the check once the corresponding Echo patch is
+                       // merged, $data should be always an instance of 
EchoEvent
+                       if ( $data instanceof \EchoEvent ) {
+                               $extra = $data->getExtra();
+                       } else {
+                               $extra = $data->event_extra;
+                       }
                        if ( isset( $extra['post-id'] ) ) {
                                return $extra['post-id'];
                        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5dc82a66f3aa289da1ff1a2f1ccd2db548b6bb66
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: SG <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to