Project

General

Profile

Actions

Feature #62554

closed

EXT:form - OptionElement class improvment

Added by taywa gmbh about 10 years ago. Updated almost 9 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2014-10-30
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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
Actions

Also available in: Atom PDF