From afa2ea386b297858f8d78ad9f5fb41f4a691189e Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 5 Mar 2020 16:14:01 +0100 Subject: [PATCH] fix(form): hidden questions still consume 10 pixels height Signed-off-by: Thierry Bugier --- css/styles.css | 2 +- inc/form.class.php | 2 +- inc/question.class.php | 3 +++ inc/questionregex.class.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/css/styles.css b/css/styles.css index 6016a28cd..c1675b8a4 100644 --- a/css/styles.css +++ b/css/styles.css @@ -223,7 +223,7 @@ form.formcreator_form { } .formcreator_form .form-group { - padding: 5px 15px; + padding: 0 15px; } .formcreator_form .form-group > label { diff --git a/inc/form.class.php b/inc/form.class.php index 0a32fe8d8..872bb7173 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -1898,7 +1898,7 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con global $DB; if (!isset($input['uuid']) && !isset($input['id'])) { - throw new ImportFailureException('UUID or ID is mandatory'); + throw new ImportFailureException(''); } $formFk = PluginFormcreatorForm::getForeignKeyField(); diff --git a/inc/question.class.php b/inc/question.class.php index a743b8844..66b3f6f68 100644 --- a/inc/question.class.php +++ b/inc/question.class.php @@ -1003,6 +1003,9 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con if (isset($input['_parameters'])) { $parameters = $field->getParameters(); foreach ($parameters as $fieldName => $parameter) { + if (false === ($input['_parameters'][$input['fieldtype']][$fieldName])) { + continue; + } $parameter::import($linker, $input['_parameters'][$input['fieldtype']][$fieldName], $itemId); } } diff --git a/inc/questionregex.class.php b/inc/questionregex.class.php index 96ba2f57c..9b759cd8e 100644 --- a/inc/questionregex.class.php +++ b/inc/questionregex.class.php @@ -120,7 +120,7 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con global $DB; if (!isset($input['uuid']) && !isset($input['id'])) { - throw new ImportFailureException('UUID or ID is mandatory'); + throw new ImportFailureException(''); } $questionFk = PluginFormcreatorQuestion::getForeignKeyField();