Hoist validation errors from hidden fields to the top of the form
authorGergő Tisza <gtisza@wikimedia.org>
Tue, 15 Sep 2015 21:49:25 +0000 (21:49 +0000)
committerGergő Tisza <gtisza@wikimedia.org>
Fri, 25 Sep 2015 17:40:30 +0000 (17:40 +0000)
commit16076cbf9931d84098db3e3aa2d9e3e6bf049796
tree4d510b5ad67ccd90dcc4d229560271d3af33a16d
parentb76b737b1c18d22fbf8ad0c66100b0014e67df37
Hoist validation errors from hidden fields to the top of the form

HTMLFormField subclasses are supposed to handle error display but
some (like hidden fields) have no means of doing this. Add
a HTMLFormField::canDisplayErrors() method which can be overridden
to return false, in which case HTMLForm will take care of the
error display.

Also adds a 'rawmessage' message which can be used to wrap
arbitrary text. This can be passed to methods which expect a message
specifier array but do not allow a message object (so the RawMessage
class cannot be used), such as HTMLFormField::trySubmit().

Bug: T112635
Change-Id: I5d73536805774ff2ee0ec64b5442650c4888dc84
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLFormField.php
includes/htmlform/HTMLHiddenField.php
languages/i18n/en.json
languages/i18n/qqq.json