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

Change subject: Document wbptterms param to pageterms query
......................................................................


Document wbptterms param to pageterms query

Provide the three valid values Term::TYPE_ALIAS, Term::TYPE_DESCRIPTION,
Term::TYPE_LABEL.
Based on behavior and a comment in lib/includes/store/TermIndex.php, I
added "If not specified, all types are returned."

Bug: T94948
Change-Id: Ifa7ba3abea713b8f39e574d572c8e0f292202973
---
M client/i18n/en.json
M client/includes/api/PageTerms.php
2 files changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/client/i18n/en.json b/client/i18n/en.json
index 5b222e6..33f1ba7 100644
--- a/client/i18n/en.json
+++ b/client/i18n/en.json
@@ -14,7 +14,7 @@
        "apihelp-query+pageterms-description": "Get terms associated with a 
page via an associated data item.",
        "apihelp-query+pageterms-example-simple": "Get all terms associated 
with the page 'London', in the user language.",
        "apihelp-query+pageterms-example-label-en": "Get labels and aliases 
associated with the page 'London', in English.",
-       "apihelp-query+pageterms-param-terms": "The kinds of terms to get, e.g. 
'label', 'description', or 'alias'.",
+       "apihelp-query+pageterms-param-terms": "The types of terms to get, e.g. 
'description'. If not specified, all types are returned.",
        "apihelp-query+wikibase-description": "Get information about the 
associated Wikibase repository.",
        "apihelp-query+wikibase-example": "Get URL path and other information 
for the Wikibase repository.",
        "apihelp-query+wikibase-param-prop": "Which properties to 
get:\n;<kbd>url</kbd>: Base URL, script path and article path.",
diff --git a/client/includes/api/PageTerms.php 
b/client/includes/api/PageTerms.php
index d8f7c5b..2ad55eb 100644
--- a/client/includes/api/PageTerms.php
+++ b/client/includes/api/PageTerms.php
@@ -239,6 +239,8 @@
                                ApiBase::PARAM_TYPE => 'integer',
                        ),
                        'terms' => array(
+                               // XXX Ought to get this list from 
Wikibase\Term, its setType() also hardcodes it.
+                               ApiBase::PARAM_TYPE => array( Term::TYPE_ALIAS, 
Term::TYPE_DESCRIPTION, Term::TYPE_LABEL ),
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_HELP_MSG => 
'apihelp-query+pageterms-param-terms',
                        ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa7ba3abea713b8f39e574d572c8e0f292202973
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Spage <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to