Last modified: 2012-04-16 09:15:46 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 T30797, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28797 - ApiBlock doesn't recognise ipb_already_blocked
ApiBlock doesn't recognise ipb_already_blocked
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Unprioritized trivial (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-03 15:29 UTC by Max Semenik
Modified: 2012-04-16 09:15 UTC (History)
7 users (show)

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


Attachments

Description Max Semenik 2011-05-03 15:29:49 UTC
{
	"servedby": "xxxxxx",
	"error": {
		"code": "unknownerror",
		"info": "Unknown error: ``ipb_already_blocked''"
	}
}
Comment 1 Roan Kattouw 2011-05-05 15:14:49 UTC
It's declared in /branches/REL1_17/phase3/includes/api/ApiBase.php so I don't see how this could happen. Are you still seeing this behavior in the 1.17.0b1 release?
Comment 2 Max Semenik 2011-05-05 15:28:57 UTC
No, 1.17 works fine:

{
	"servedby": "*****",
	"error": {
		"code": "alreadyblocked",
		"info": "The user you tried to block was already blocked"
	}
}
Comment 3 Roan Kattouw 2011-05-05 15:29:51 UTC
Then why is this bug in the 1.17.0beta1 component, and which version are you seeing this on? :)
Comment 4 Max Semenik 2011-05-05 15:30:59 UTC
Shaky hands? :) It's on trunk, sorry.
Comment 5 Roan Kattouw 2011-05-05 15:33:17 UTC
(In reply to comment #4)
> Shaky hands? :) It's on trunk, sorry.
A quick glance at trunk seems to indicate this issue /should/ not happen there either (the message is defined in ApiBase.php, grep 'ipb_already_blocked'). I'll try to reproduce it later.
Comment 6 Max Semenik 2011-05-05 16:01:00 UTC
Broken by r83786, as bisect indicates.
Comment 7 Happy-melon 2011-05-07 13:06:43 UTC
Fixed in r87627.  It was actually a bug in the API which was exposed by r83796, rather than being introduced by it.
Comment 8 Roan Kattouw 2011-05-09 11:43:31 UTC
(In reply to comment #7)
> Fixed in r87627.  It was actually a bug in the API which was exposed by r83796,
> rather than being introduced by it.
The function you "fixed" doesn't expect nested arrays, and the documentation mentions this (even if in passing; it says it expects and *element* of a nested errors array), so whatever was feeding it nested arrays was at fault. The array_shift()ing was done by the callers.

Either way, it's probably cleaner to make the de-nesting the responsibility of parseMsg() like you did.

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


Navigation
Links