From 5206fdd19f7bb75bd775f9326ecd2c57b3268058 Mon Sep 17 00:00:00 2001 From: Ian Lindsay Date: Wed, 5 Jun 2024 01:55:30 +0100 Subject: [PATCH] fix: VOL-5507 remove incorrect calls to Laminas number element that was breaking validation --- .../CurrentDiscs/Fieldset/InPossessionInfo.php | 3 --- .../Form/Surrender/CurrentDiscs/Fieldset/LostInfo.php | 3 --- .../Surrender/CurrentDiscs/Fieldset/StolenInfo.php | 10 ++++++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/InPossessionInfo.php b/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/InPossessionInfo.php index 78aa7c0f0..19c2aebe6 100644 --- a/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/InPossessionInfo.php +++ b/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/InPossessionInfo.php @@ -11,14 +11,11 @@ class InPossessionInfo * @Form\Required(true) * @Form\AllowEmpty(true) * @Form\ContinueIfEmpty(true) - * @Form\Type("Number") * @Form\Options({ * "label":"licence.surrender.current_discs.destroy.number.label", * }) * @Form\Attributes({ * "class":"govuk-input govuk-!-width-one-third", - * "step": "any", - * "min": 0 * }) * @Form\Validator("ValidateIf", * options={ diff --git a/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/LostInfo.php b/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/LostInfo.php index ace66ed05..dea4c3fd4 100644 --- a/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/LostInfo.php +++ b/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/LostInfo.php @@ -11,14 +11,11 @@ class LostInfo * @Form\Required(true) * @Form\AllowEmpty(true) * @Form\ContinueIfEmpty(true) - * @Form\Type("Number") * @Form\Options({ * "label": "licence.surrender.current_discs.lost.label", * }) * @Form\Attributes({ * "class": "govuk-input govuk-!-width-one-third", - * "step": "any", - * "min": 0 * }) * @Form\Validator("ValidateIf", * options={ diff --git a/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/StolenInfo.php b/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/StolenInfo.php index eea098ff4..ea23125f8 100644 --- a/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/StolenInfo.php +++ b/module/Olcs/src/Form/Model/Form/Surrender/CurrentDiscs/Fieldset/StolenInfo.php @@ -9,16 +9,12 @@ class StolenInfo /** * @Form\Name("number") * @Form\Required(true) - * @Form\AllowEmpty(true) * @Form\ContinueIfEmpty(true) - * @Form\Type("Number") * @Form\Options({ * "label":"licence.surrender.current_discs.stolen.number.label", * }) * @Form\Attributes({ * "class":"govuk-input govuk-!-width-one-third", - * "step": "any", - * "min": 0 * }) * @Form\Validator("ValidateIf", * options={ @@ -27,6 +23,12 @@ class StolenInfo * "inject_post_data": "stolenSection->stolen", * "validators": { * { + * "name": "NotEmpty", + * "options": { + * "messages": {"isEmpty" : "Value is required and can't be empty"}, + * } + * }, + * { * "name": "Digits", * "options": { * "break_chain_on_failure": true,