ApiErrorFormatter_BackCompat: Use first error, not last
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 17 Jan 2017 15:51:27 +0000 (10:51 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 17 Jan 2017 16:00:55 +0000 (11:00 -0500)
commit382450573d494d955e7718fdb38bda35f87a6fb2
tree8aaa18e993cb897860198f074c6d0c23446b6bab
parent2aec74858cf0314d926a7fda82d8ca48990c0334
ApiErrorFormatter_BackCompat: Use first error, not last

Before Iae0e2ce3b, the only place in the API that had to deal with
choosing from multiple errors was ApiBase::dieStatus(), which chose the
first one in the Status object. Iae0e2ce3b changed this to choose the
last one instead, which is an unnecessary backwards compatibility break.

While we could make the change in ApiBase::dieStatus(), it's cleaner to
change ApiErrorFormatter_BackCompat's behavior instead since it seems
unlikely anything else was using that code path.

Bug: T155268
Change-Id: Ia06527f8480c3d4a689792ceb8671b0d399ffbe3
includes/api/ApiErrorFormatter.php
tests/phpunit/includes/api/ApiErrorFormatterTest.php