HTMLTitleTextField: Allow this field to not be required
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 7 May 2018 18:57:32 +0000 (20:57 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 7 May 2018 18:57:51 +0000 (20:57 +0200)
commitf88a5a18155a0f9fa64683feabefef83bffa85a3
tree31ee115e3552b1130722da46d7ac47862fbf9205
parent33912421c84a86e0386069ddba358f42fadc249e
HTMLTitleTextField: Allow this field to not be required

Previously we would always run the validation, and it would fail when
the field was empty, since empty string is not a valid title.

Respect the 'required' option (defined by HTMLFormField) and make it
default to true for compatibility with existing forms that might rely
on this.

Also add a TODO comment about a confusing special case in validation
code. I don't want to dig into that.

Change-Id: I93ad51ffe7bee597d2d127f4c5d6b2929ffc8f7e
includes/htmlform/fields/HTMLTitleTextField.php