#62554EXT:form - OptionElement class improvment
Description
after line 87 in the function checkFilterAndSetIncomingDataFromRequest the value of the element is set to it’s ID if it’s empty.
this does not convey anything about the data if the form submit is handled by a different script/url. it would make much more sense to set it to something akin to the data. like:
if ($this->value === '') {
$value = preg_replace('/\\s/', '_', (string) $this->data);
$this->value = preg_replace('/[^a-zA-Z0-9_\\-]/', '', $value);
$this->setAttribute('value', $this->value);
}
or – if the id as value is needed somwhere else in the sysext, there should be a TS configuration option for the FORM object or the SELECT object – like
lib.form = FORM lib.form.optionsDefaultDataFromValue = 1
or
lib.form = FORM lib.form.10 = SELECT lib.form.10.defaultDataFromValue = 1
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.