From cb04c8b721af56b5bdfcbe6b119ebd18d867a3f7 Mon Sep 17 00:00:00 2001 From: Carsten Rose <carsten.rose@math.uzh.ch> Date: Mon, 18 Apr 2016 22:49:37 +0200 Subject: [PATCH] FE 'Select / Radio / Checkbox' crashed without a corresponding column. AbstractBuildForm.php: check if there is a column with the formElementName. --- extension/qfq/qfq/AbstractBuildForm.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension/qfq/qfq/AbstractBuildForm.php b/extension/qfq/qfq/AbstractBuildForm.php index 88910c5c8..7bffa0047 100644 --- a/extension/qfq/qfq/AbstractBuildForm.php +++ b/extension/qfq/qfq/AbstractBuildForm.php @@ -756,7 +756,10 @@ abstract class AbstractBuildForm { if (count($formElement) < 20) throw new CodeException("Invalid (none or to small) Formelement", ERROR_MISSING_FORMELEMENT); - $itemValue = $this->getItemsForEnumOrSet($formElement['name'], $fieldType); + // Call getItemsForEnumOrSet() only if there a corresponding column really exist. + if (false !== $this->store->getVar($formElement['name'], STORE_RECORD)) { + $itemValue = $this->getItemsForEnumOrSet($formElement['name'], $fieldType); + } if (is_array($formElement['sql1'])) { if (count($formElement['sql1']) > 0) { -- GitLab