Commit 6f224ef2 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractBuildForm.php: #2064 / Input Elemente die als JSON response...

AbstractBuildForm.php: #2064 / Input Elemente die als JSON response 'value=false' bekommen, zeigen 'false' an -- check if a FormElement is a real tableColumn by using STORE_RECORD is a bad idea, cause new records always deliver 'false'. Now take the STORE_TABLE_COLUMN_TYPES as a reference.
parent 8879ae44
......@@ -402,14 +402,16 @@ abstract class AbstractBuildForm {
// $value = ($formElement[FE_VALUE] === '') ? $this->store->getVar($name, $storeUse,
// $formElement['checkType']) : $formElement[FE_VALUE];
// If there is a value explicit defined: take it
$value = $formElement[FE_VALUE];
// If there is no value, check the default.
//
if ($value === '') {
// Only take the default, if the FE is a real tablecolumn.
if ($this->store->getVar($formElement[FE_NAME], STORE_RECORD) !== false) {
if ($this->store->getVar($formElement[FE_NAME], STORE_TABLE_COLUMN_TYPES) !== false) {
$value = $this->store->getVar($name, $storeUse, $formElement['checkType']);
}
}
// Typically: $htmlElementNameIdZero = true
// After Saving a record, staying on the form, the FormElements on the Client are still known as '<feName>:0'.
$htmlFormElementId = HelperFormElement::buildFormElementName($formElement[FE_NAME], ($htmlElementNameIdZero) ? 0 : $recordId);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment