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

Change subject: Revert "Allow for both ids and sites/titles to be set for 
wbgetentities"
......................................................................


Revert "Allow for both ids and sites/titles to be set for wbgetentities"

This reverts commit 713cd872d5e072e9b70deaea8b0cee6f2bdb44bf.

Change-Id: I935678bb5aada4c915549ce3fd9c6597e4784b20
---
M repo/includes/api/GetEntities.php
1 file changed, 2 insertions(+), 8 deletions(-)

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



diff --git a/repo/includes/api/GetEntities.php 
b/repo/includes/api/GetEntities.php
index 0f2caec..64ca636 100644
--- a/repo/includes/api/GetEntities.php
+++ b/repo/includes/api/GetEntities.php
@@ -57,22 +57,16 @@
 
                $params = $this->extractRequestParams();
 
-               if ( !isset( $params['ids'] ) && ( empty( $params['sites'] ) || 
empty( $params['titles'] ) ) ) {
+               if ( !( isset( $params['ids'] ) XOR ( !empty( $params['sites'] 
) && !empty( $params['titles'] ) ) ) ) {
                        wfProfileOut( __METHOD__ );
                        $this->dieUsage( 'Either provide the item "ids" or 
pairs of "sites" and "titles" for corresponding pages', 'param-missing' );
                }
 
                if ( !isset( $params['ids'] ) ) {
-                       // Since we merge into this, just create it
-                       $params['ids'] = array();
-               }
-
-               if ( !empty( $params['sites'] ) ) {
                        $siteLinkCache = 
StoreFactory::getStore()->newSiteLinkCache();
                        $siteStore = \SiteSQLStore::newInstance();
                        $itemByTitleHelper = new ItemByTitleHelper( $this, 
$siteLinkCache, $siteStore, $this->stringNormalizer );
-                       $otherIDs = $itemByTitleHelper->getEntityIds( 
$params['sites'], $params['titles'], $params['normalize'] );
-                       $params['ids'] = array_merge( $params['ids'], $otherIDs 
);
+                       $params['ids'] = $itemByTitleHelper->getEntityIds( 
$params['sites'], $params['titles'], $params['normalize'] );
                }
 
                $params['ids'] = $this->uniqueEntities( $params['ids'] );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I935678bb5aada4c915549ce3fd9c6597e4784b20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.22-wmf14
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to