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

Change subject: Don't trigger warning if "bot" parameter is missing in API 
request
......................................................................


Don't trigger warning if "bot" parameter is missing in API request

I don't think it's required to always have the "bot" parameter set
in the request. It could be "0", empty or simply not exist. All
other parameters are optional, so shouldn't this one too? The
inline documentation doesn't say it's required.

For some strange reason this triggers "Undefined index" errors in a
completely unrelated patch. I didn't spent time on deeper
investigation since I think this is a proper solution.

Change-Id: Ie0650ebe41a328f0576e304c67a7c1f852a0e72b
(cherry picked from commit a9edd2029e76c0a34a809aa4b730ecebe6affe91)
---
M repo/includes/api/ApiWikibase.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index 81db295..10dc42c 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -477,7 +477,8 @@
                $params = $this->extractRequestParams();
                $user = $this->getUser();
 
-               $flags |= ( $user->isAllowed( 'bot' ) && $params['bot'] ) ? 
EDIT_FORCE_BOT : 0;
+               $bot = isset( $params['bot'] ) ? $params['bot'] : false;
+               $flags |= ( $bot && $user->isAllowed( 'bot' ) ) ? 
EDIT_FORCE_BOT : 0;
 
                $baseRevisionId = isset( $params['baserevid'] ) ? intval( 
$params['baserevid'] ) : null;
                $baseRevisionId = $baseRevisionId > 0 ? $baseRevisionId : false;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0650ebe41a328f0576e304c67a7c1f852a0e72b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.23-wmf19
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to