Last modified: 2008-10-26 10:49:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18115, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16115 - API blocking broken where $wgBlockAllowsUTEdit is true
API blocking broken where $wgBlockAllowsUTEdit is true
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.14.x
All All
: Normal major (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-25 19:47 UTC by Alex Z.
Modified: 2008-10-26 10:49 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Alex Z. 2008-10-25 19:47:45 UTC
API blocking is currently broken if $wgBlockAllowsUTEdit is set to true:

<?xml version="1.0"?>
<api>
  <error code="internal_api_error_MWException" info="Exception Caught: Internal error in ApiBase::getParameterFromSettings: Boolean param allowusertalk&#039;s default is set to &#039;1&#039;">

#0 /usr/local/apache/common-local/php-1.5/includes/api/ApiBase.php(761): wfDebugDieBacktrace('Internal error ...')
#1 /usr/local/apache/common-local/php-1.5/includes/api/ApiBase.php(465): ApiBase::dieDebug('ApiBase::getPar...', 'Boolean param a...')
#2 /usr/local/apache/common-local/php-1.5/includes/api/ApiBase.php(381): ApiBase->getParameterFromSettings('allowusertalk', true, true)
#3 /usr/local/apache/common-local/php-1.5/includes/api/ApiBlock.php(54): ApiBase->extractRequestParams()
#4 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(425): ApiBlock->execute()
#5 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(258): ApiMain->executeAction()
#6 /usr/local/apache/common-local/php-1.5/includes/api/ApiMain.php(242): ApiMain->executeActionWithErrorHandling()
#7 /usr/local/apache/common-local/php-1.5/api.php(77): ApiMain->execute()
#8 /usr/local/apache/common-local/live-1.5/api.php(3): require('/usr/local/apac...')
#9 {main}

</error>
</api>
Comment 1 Roan Kattouw 2008-10-25 22:23:24 UTC
For some crazy reason, the wiki this error is occurring on seems to have $wgBlockAllowsUTEdit set to 1 rather than true. Of course this should be handled gracefully. Trivial fix applied in r42583.
Comment 2 Alex Z. 2008-10-25 22:54:34 UTC
No, that error is from en.wikipedia. I also get it on my local install, even after updating past r42583. Looking at it deeper, the problem seems to be that ApiBase::getParameterFromSettings() requires that default values for boolean parameters is set to false. 
Comment 3 Roan Kattouw 2008-10-26 10:49:01 UTC
(In reply to comment #2)
> No, that error is from en.wikipedia. I also get it on my local install, even
> after updating past r42583. Looking at it deeper, the problem seems to be that
> ApiBase::getParameterFromSettings() requires that default values for boolean
> parameters is set to false. 
> 

Hmm, actually that seems like a very sane thing to do. Something I completely forgot about when writing comment #1 (and when reviewing r41536) is that whether a boolean parameter is considered true or false is determined by its presence. For this reason, a default value of true is very evil, because that makes setting the parameter to false impossible.

Bug as filed fixed in r42611 by setting the default value to false. This means the fatal error goes away, but it also means you'll have to set &allowusertalk yourself, even if $wgBlockAllowsUTEdit is true. Of course, if $wgBlockAllowsUTEdit is false, setting &allowusertalk does nothing.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links