Return messages in a consistent form from Status objects
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 17 Jul 2013 17:11:56 +0000 (19:11 +0200)
committerTim Starling <tstarling@wikimedia.org>
Tue, 30 Jul 2013 02:11:48 +0000 (02:11 +0000)
commitb8c3140723d0eb8df0c888ea95976608112c21c7
tree3c649367bb752021540672462016342d36929d65
parentebabe9fa35b904a7bc5ad74cb38c8c17b93b35b2
Return messages in a consistent form from Status objects

Also fixes Message::getKey() to always return a string.

Rationale:

Some code, like RollbackAction, assumes that Status::getErrorArray will
return an array of the form ( messagekey, param... ), but this was not
the case when a Message object was passed to the Status.

This change makes sure Status::getErrorArray will always return arrays
of the expected form. This is especially important since the messages in
the Status object may be provided by extensions.

In order to convert Message objects to arrays of message keys and parameters,
Message::getKey() needed to be fixed to return a single key always.

Bug: 49338
Change-Id: I0deaa9888e9d86726a8e41ca606c571f56190c91
includes/Message.php
includes/Status.php