HTMLTitleTextField: Remove incorrect check for unsubmitted GET forms
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 17 Jul 2018 23:35:45 +0000 (01:35 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 17 Jul 2018 23:35:45 +0000 (01:35 +0200)
commit06c49e69dc0331f28dce61df2fc8d8fd59fb8e3c
treef360863218f997616e06048814157a251ec0eead
parent500f7a5bad20004fcf8a87d46428d0a20d9cd97b
HTMLTitleTextField: Remove incorrect check for unsubmitted GET forms

This check was added in I605f32048fe97eebd7e04b6ffd799759aeb7f31e,
to fix an issue on Special:ChangeContentModel that was pointed out
in code review of I766da59e6cbf7ed8f887d1a684ea9e284e9cf67e.

This code actually does nothing in most cases, because `$value` for
unsubmitted forms comes from the getDefault() method, and it is
`null` and not `''`, unless specifically overridden. As it happens,
Special:ChangeContentModel overrides the default to `''`, so this
worked there.

However, this was a brittle hack, and another change recently broke
Special:ChangeContentModel in the exact way this was supposed to
avoid: T196514. There is a pending patch there to fix it properly.

The proper way to avoid validation errors on initial view of a GET
form is to call setFormIdentifier( … ) on the form, which allows
HTMLForm code to detect whether the form was really submitted.

Change-Id: Id6a449bfa313d470ae4c39455e58b36252dc6b43
includes/htmlform/fields/HTMLTitleTextField.php
includes/htmlform/fields/HTMLUserTextField.php