jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/376704 )
Change subject: Add form API module
..
Add form API module
Bug: T164742
Change-Id: I93b23c591b2a08c2106291d0ca1832b3ab3c7cf6
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A src/Api/AddForm.php
M src/Api/AddFormRequest.php
M src/ChangeOp/ChangeOpAddForm.php
M src/DataModel/Serialization/ExternalLexemeSerializer.php
M src/DataModel/Services/Diff/LexemeDiff.php
M tests/phpunit/composer/DataModel/Serialization/StorageLexemeSerializerTest.php
M tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferTest.php
A tests/phpunit/mediawiki/Api/AddFormTest.php
11 files changed, 466 insertions(+), 3 deletions(-)
Approvals:
WMDE-leszek: Checked; Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index ad5163b..1e939df 100644
--- a/extension.json
+++ b/extension.json
@@ -381,5 +381,11 @@
"SpecialPages": {
"NewLexeme":
"Wikibase\\Lexeme\\Specials\\SpecialNewLexeme::newFromGlobalState"
},
+ "APIModules": {
+ "wblexemeaddform": {
+ "class": "Wikibase\\Lexeme\\Api\\AddForm",
+ "factory":
"Wikibase\\Lexeme\\Api\\AddForm::newFromGlobalState"
+ }
+ },
"manifest_version": 1
}
diff --git a/i18n/en.json b/i18n/en.json
index ce2af99..01bd811 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -29,5 +29,22 @@
"datatypes-type-wikibase-lexeme-form": "Lexeme Form",
"datatypes-type-wikibase-lexeme-sense": "Lexeme Sense",
"wikibase-lexeme-add-sense": "add sense",
- "wikibase-lexeme-add-form": "add form"
+ "wikibase-lexeme-add-form": "add form",
+ "apihelp-wblexemeaddform-summary": "Adds Form to Lexeme",
+ "apihelp-wblexemeaddform-param-lexemeId": "ID of the Lexeme e.g. L10",
+ "apihelp-wblexemeaddform-param-data": "JSON encoded data for Form i.e.
representations and grammaticalFeatures",
+ "apihelp-wblexemeaddform-param-bot": "Mark this edit as bot. This URL
flag will only be respected if the user belongs to the group
\"{{int:group-bot}}\".",
+ "wikibase-lexeme-api-addform-lexemeid-invalid": "Invalid lexeme ID
provided as \"lexemeId\"",
+ "wikibase-lexeme-api-addform-lexemeid-not-lexeme-id": "$1 is not a
lexeme ID",
+ "wikibase-lexeme-api-addform-data-not-array": "\"data\" must be an
array",
+ "wikibase-lexeme-api-addform-data-representations-key-missing": "No
\"representations\" key in \"data\"",
+ "wikibase-lexeme-api-addform-data-invalid-json": "\"data\" is not a
valid JSON",
+ "wikibase-lexeme-api-addform-data-grammatical-features-key-missing":
"No \"grammaticalFeatures\" key in \"data\"",
+ "wikibase-lexeme-api-addform-data-representations-not-array":
"\"representations\" must be an array",
+ "wikibase-lexeme-api-addform-data-grammatical-features-not-array":
"\"grammaticalFeatures\" must be an array",
+ "wikibase-lexeme-api-addform-representations-empty": "At least a single
representation must be provided",
+ "wikibase-lexeme-api-addform-representation-text-missing": "No
representation string provided for representation at position $1",
+ "wikibase-lexeme-api-addform-representation-language-missing": "No
language provided for representation at position $1",
+ "wikibase-lexeme-api-addform-grammatical-feature-itemid-invalid":
"Invalid grammatical feature: $1",
+ "wikibase-lexeme-api-addform-grammatical-feature-not-item-id": "Not an
item ID: $1"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a319135..9d4241c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -34,5 +34,22 @@
"datatypes-type-wikibase-lexeme-form": "The name of a data type for
lexeme forms in Wikibase.",
"datatypes-type-wikibase-lexeme-sense": "The name of a data type for
lexeme senses in Wikibase.",
"wikibase-lexeme-add-sense": "Label for button to add a new sense",
- "wikibase-lexeme-add-form": "Label for button to add a new form"
+ "wikibase-lexeme-add-form": "Label for button to add a new form",
+ "apihelp-wblexemeaddform-summary":
"{{doc-apihelp-summary|wblexemeaddform}}",
+ "apihelp-wblexemeaddform-param-lexemeId":
"{{doc-apihelp-param|wblexemeaddform|lexemeId}}",
+ "apihelp-wblexemeaddform-param-data":
"{{doc-apihelp-param|wblexemeaddform|data}}",
+ "apihelp-wblexemeaddform-param-bot":
"{{doc-apihelp-param|wblexemeaddform|bot}}",
+ "wikibase-lexeme-api-addform-lexemeid-invalid": "API error description",
+ "wikibase-lexeme-api-addform-lexemeid-not-lexeme-id": "API error
description",
+ "wikibase-lexeme-api-addform-data-not-array": "API error description",
+ "wikibase-lexeme-api-addform-data-representations-key-missing": "API
error description",
+