jenkins-bot has submitted this change and it was merged.
Change subject: Fix incomplete wbsearchentities options in entityselector
......................................................................
Fix incomplete wbsearchentities options in entityselector
Bug: T109584
Change-Id: Iadc9500b65a8d4de45ea16e8d1cfb86065a01dd9
---
M src/RepoApi.js
1 file changed, 18 insertions(+), 34 deletions(-)
Approvals:
Jonas Kress (WMDE): Looks good to me, approved
jenkins-bot: Verified
diff --git a/src/RepoApi.js b/src/RepoApi.js
index 8b17111..9e29a50 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -88,8 +88,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
editEntity: function( id, baseRevId, data, clear ) {
- if(
- typeof id !== 'string'
+ if( typeof id !== 'string'
|| typeof baseRevId !== 'number'
|| typeof data !== 'object'
|| clear && typeof clear !== 'boolean'
@@ -130,8 +129,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
formatValue: function( dataValue, options, dataType, outputFormat ) {
- if(
- typeof dataValue !== 'object'
+ if( typeof dataValue !== 'object'
|| options && typeof options !== 'object'
|| dataType && typeof dataType !== 'string'
|| outputFormat && typeof outputFormat !== 'string'
@@ -181,8 +179,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
getEntities: function( ids, props, languages, sort, dir ) {
- if(
- ( typeof ids !== 'string' && !$.isArray( ids ) )
+ if( ( typeof ids !== 'string' && !$.isArray( ids ) )
|| props && ( typeof props !== 'string' && !$.isArray(
props ) )
|| languages && ( typeof languages !== 'string' &&
!$.isArray( languages ) )
|| sort && ( typeof sort !== 'string' && !$.isArray(
sort ) )
@@ -233,8 +230,7 @@
* @throws {Error} if both, `sites` and `titles`, are passed as
`array`s.
*/
getEntitiesByPage: function( sites, titles, props, languages, sort,
dir, normalize ) {
- if(
- ( typeof sites !== 'string' && !$.isArray( sites ) )
+ if( ( typeof sites !== 'string' && !$.isArray( sites ) )
|| ( typeof titles !== 'string' && !$.isArray( titles )
)
|| props && ( typeof props !== 'string' && !$.isArray(
props ) )
|| languages && ( typeof languages !== 'string' &&
!$.isArray( languages ) )
@@ -279,8 +275,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
parseValue: function( parser, values, options ) {
- if(
- typeof parser !== 'string'
+ if( typeof parser !== 'string'
|| !$.isArray( values )
|| options && typeof options !== 'object'
) {
@@ -316,8 +311,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
searchEntities: function( search, language, type, limit, offset ) {
- if(
- typeof search !== 'string'
+ if( typeof search !== 'string'
|| typeof language !== 'string'
|| typeof type !== 'string'
) {
@@ -328,6 +322,7 @@
action: 'wbsearchentities',
search: search,
language: language,
+ uselang: language,
type: type,
limit: typeof limit === 'number' ? limit : undefined,
'continue': typeof offset === 'number' ? offset :
undefined
@@ -355,8 +350,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
setLabel: function( id, baseRevId, label, language ) {
- if(
- typeof id !== 'string'
+ if( typeof id !== 'string'
|| typeof baseRevId !== 'number'
|| typeof label !== 'string'
|| typeof language !== 'string'
@@ -394,8 +388,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
setDescription: function( id, baseRevId, description, language ) {
- if(
- typeof id !== 'string'
+ if( typeof id !== 'string'
|| typeof baseRevId !== 'number'
|| typeof description !== 'string'
|| typeof language !== 'string'
@@ -435,8 +428,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
setAliases: function( id, baseRevId, add, remove, language ) {
- if(
- typeof id !== 'string'
+ if( typeof id !== 'string'
|| typeof baseRevId !== 'number'
|| !$.isArray( add )
|| !$.isArray( remove )
@@ -514,8 +506,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
createClaim: function( entityId, baseRevId, snakType, propertyId, value
) {
- if(
- typeof entityId !== 'string'
+ if( typeof entityId !== 'string'
|| typeof baseRevId !== 'number'
|| typeof snakType !== 'string'
|| typeof propertyId !== 'string'
@@ -556,8 +547,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
removeClaim: function( claimGuid, claimRevisionId ) {
- if(
- typeof claimGuid !== 'string'
+ if( typeof claimGuid !== 'string'
|| claimRevisionId && typeof claimRevisionId !==
'number'
) {
throw new Error( 'Parameter not specified properly' );
@@ -598,8 +588,7 @@
* @throws {Error} if neither `entityId` nor `claimGuid` is provided.
*/
getClaims: function( entityId, propertyId, claimGuid, rank, props ) {
- if(
- entityId && typeof entityId !== 'string'
+ if( entityId && typeof entityId !== 'string'
|| propertyId && typeof propertyId !== 'string'
|| claimGuid && typeof claimGuid !== 'string'
|| rank && typeof rank !== 'string'
@@ -645,8 +634,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
setClaimValue: function( claimGuid, baseRevId, snakType, propertyId,
value ) {
- if(
- typeof claimGuid !== 'string'
+ if( typeof claimGuid !== 'string'
|| typeof baseRevId !== 'number'
|| typeof snakType !== 'string'
|| typeof propertyId !== 'string'
@@ -702,8 +690,7 @@
referenceHash = undefined;
}
- if(
- typeof statementGuid !== 'string'
+ if( typeof statementGuid !== 'string'
|| typeof snaks !== 'object'
|| typeof baseRevId !== 'number'
|| referenceHash && typeof referenceHash !== 'string'
@@ -750,8 +737,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
removeReferences: function( statementGuid, referenceHashes, baseRevId )
{
- if(
- typeof statementGuid !== 'string'
+ if( typeof statementGuid !== 'string'
|| typeof referenceHashes !== 'string' && !$.isArray(
referenceHashes )
|| typeof baseRevId !== 'number'
) {
@@ -788,8 +774,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
setSitelink: function( id, baseRevId, site, title, badges ) {
- if(
- typeof id !== 'string'
+ if( typeof id !== 'string'
|| typeof baseRevId !== 'number'
|| typeof site !== 'string'
|| typeof title !== 'string'
@@ -832,8 +817,7 @@
* @throws {Error} if a parameter is not specified properly.
*/
mergeItems: function( fromId, toId, ignoreConflicts, summary ) {
- if(
- typeof fromId !== 'string'
+ if( typeof fromId !== 'string'
|| typeof toId !== 'string'
|| ignoreConflicts
&& typeof ignoreConflicts !== 'string'
--
To view, visit https://gerrit.wikimedia.org/r/232725
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iadc9500b65a8d4de45ea16e8d1cfb86065a01dd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits