Kaldari has submitted this change and it was merged.

Change subject: Fix API in XML format
......................................................................


Fix API in XML format

We weren't setting the XML tag name used for notifications, so this was causing 
a fatal error.

Bug: 48009
Change-Id: I676f7e7fee1167d02ed35920719105d3ca260e74
---
M api/ApiEchoNotifications.php
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Kaldari: Verified; Looks good to me, approved



diff --git a/api/ApiEchoNotifications.php b/api/ApiEchoNotifications.php
index 45a2c91..296d8c8 100644
--- a/api/ApiEchoNotifications.php
+++ b/api/ApiEchoNotifications.php
@@ -31,6 +31,7 @@
                        } else {
                                $result['more'] = '0';
                        }
+                       $this->getResult()->setIndexedTagName( $result['list'], 
'notification' );
                }
 
                if ( in_array( 'count', $prop ) ) {
@@ -38,7 +39,14 @@
                }
 
                if ( in_array( 'index', $prop ) ) {
-                       $result['index'] = array_keys( $result['list'] );
+                       $result['index'] = array();
+                       foreach ( array_keys( $result['list'] ) as $key ) {
+                               // Don't include the XML tag name ('_element' 
key)
+                               if ( $key != '_element' ) {
+                                       $result['index'][] = $key;
+                               }
+                       }
+                       $this->getResult()->setIndexedTagName( 
$result['index'], 'id' );
                }
 
                $this->getResult()->setIndexedTagName( $result, 'notification' 
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I676f7e7fee1167d02ed35920719105d3ca260e74
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to