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

Change subject: Simplified 'use xpath' return values to simply be strings
......................................................................


Simplified 'use xpath' return values to simply be strings

Change-Id: I71289ca8eec3809e2f949f0e2c55f6042cdbe39b
---
M ED_Utils.php
1 file changed, 9 insertions(+), 2 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ED_Utils.php b/ED_Utils.php
index 95c6be1..b7549d5 100644
--- a/ED_Utils.php
+++ b/ED_Utils.php
@@ -557,13 +557,20 @@
                        if ( !$nodes ) {
                                continue;
                        }
+
+                       // Convert from SimpleXMLElement to string.
+                       $nodesArray = array();
+                       foreach ( $nodes as $xmlNode ) {
+                               $nodesArray[] = (string)$xmlNode;
+                       }
+
                        if ( array_key_exists( $xpath, $edgXMLValues ) ) {
                                // At the moment, this code will never get
                                // called, because duplicate values in
                                // $mappings will have been removed already.
-                               $edgXMLValues[$xpath] = array_merge( 
$edgXMLValues[$xpath], (array)$nodes );
+                               $edgXMLValues[$xpath] = array_merge( 
$edgXMLValues[$xpath], $nodesArray );
                        } else {
-                               $edgXMLValues[$xpath] = (array)$nodes;
+                               $edgXMLValues[$xpath] = $nodesArray;
                        }
                }
                return $edgXMLValues;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I71289ca8eec3809e2f949f0e2c55f6042cdbe39b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ExternalData
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to