From 6f224ef2f027fc8d289b35dd618202cdd4bec99d Mon Sep 17 00:00:00 2001
From: Carsten  Rose <carsten.rose@math.uzh.ch>
Date: Mon, 27 Feb 2017 14:17:26 +0100
Subject: [PATCH] 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.

---
 extension/qfq/qfq/AbstractBuildForm.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/extension/qfq/qfq/AbstractBuildForm.php b/extension/qfq/qfq/AbstractBuildForm.php
index df11cc0ae..5714ce9a7 100644
--- a/extension/qfq/qfq/AbstractBuildForm.php
+++ b/extension/qfq/qfq/AbstractBuildForm.php
@@ -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);
-- 
GitLab