Mushroom has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/105511


Change subject: Fix ItemByTitleHelper site/title combinations
......................................................................

Fix ItemByTitleHelper site/title combinations

This patch fixes ItemByTitleHelper by allowing
requests with one title and multiple sites,
thereby partially restoring the old behavior.
Combinations of multiple titles and multiple
sites are still not allowed. Fixes bug 59676.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/11/105511/1

diff --git a/repo/includes/api/ItemByTitleHelper.php 
b/repo/includes/api/ItemByTitleHelper.php
index 6201e51..513a27c 100644
--- a/repo/includes/api/ItemByTitleHelper.php
+++ b/repo/includes/api/ItemByTitleHelper.php
@@ -82,9 +82,9 @@
                }
 
                // Restrict the crazy combinations of sites and titles that can 
be used
-               if( $numSites !== 1 && $numSites !== $numTitles  ) {
+               if ( $numSites !== 1 && $numTitles !== 1 ) {
                        $this->throwUsageException(
-                               'Must request one site or an equal number of 
sites and titles',
+                               'Must request either multiple titles on one 
site, or one title on multiple sites',
                                'params-illegal'
                        );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34ae872ec2795ad4b3e064c78bbe5596e0dcfdd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Mushroom <wikimushr...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to