diff --git a/inc/question.class.php b/inc/question.class.php index 18edf3bde..87d223e57 100644 --- a/inc/question.class.php +++ b/inc/question.class.php @@ -52,7 +52,7 @@ class PluginFormcreatorQuestion extends CommonDBChild implements static public $items_id = 'plugin_formcreator_sections_id'; /** @var PluginFormcreatorFieldInterface|null $field a field describing the question denpending on its field type */ - private ?PluginFormcreatorFieldInterface $field = null; + public ?PluginFormcreatorFieldInterface $field = null; private $skipChecks = false; diff --git a/templates/field/fieldsfield.html.twig b/templates/field/fieldsfield.html.twig index 9a7984cbe..e333cba0a 100644 --- a/templates/field/fieldsfield.html.twig +++ b/templates/field/fieldsfield.html.twig @@ -70,4 +70,20 @@ input_class: 'col-xxl-8', }) }} {% endif %} + + {{ fields.nullField({ + label_class: 'col-xxl-4', + input_class: 'col-xxl-8', + }) }} + + {{ fields.dropdownYesNo( + 'required', + item.field.getField().fields['mandatory'], + __('Required', 'formcreator'), { + label_class: 'col-xxl-4', + input_class: 'col-xxl-8', + disabled: true, + } + ) }} + {% endblock %}