Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Model/QuestionType/HiddenQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
namespace GlpiPlugin\Advancedforms\Model\QuestionType;

use Glpi\Application\View\TemplateRenderer;
use Glpi\DBAL\JsonFieldInterface;
use Glpi\Form\Condition\ConditionHandler\StringConditionHandler;
use Glpi\Form\Condition\UsedAsCriteriaInterface;
use Glpi\Form\Migration\FormQuestionDataConverterInterface;
use Glpi\Form\Question;
use Glpi\Form\QuestionType\AbstractQuestionType;
Expand All @@ -46,7 +49,10 @@
* Legacy question type from the formcreator plugin
* Original source: https://github.com/pluginsGLPI/formcreator/blob/2.13.10/inc/field/hiddenfield.class.php
*/
final class HiddenQuestion extends AbstractQuestionType implements ConfigurableItemInterface, LegacyQuestionTypeInterface
final class HiddenQuestion extends AbstractQuestionType implements
ConfigurableItemInterface,
LegacyQuestionTypeInterface,
UsedAsCriteriaInterface
{
#[Override]
public function getCategory(): QuestionTypeCategoryInterface
Expand Down Expand Up @@ -150,4 +156,11 @@ public function getMapperClass(): FormQuestionDataConverterInterface
{
return new FormcreatorHiddenTypeMapper();
}

#[Override]
public function getConditionHandlers(
?JsonFieldInterface $question_config,
): array {
return array_merge(parent::getConditionHandlers($question_config), [new StringConditionHandler()]);
}
}
Loading