From b38d6d5201bbce8ddf357efa31f39b308bcebfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Thu, 3 Sep 2026 11:09:53 +0000 Subject: [PATCH] Bug 10190: (QA follow-up): fix: keyboard delay delete behaviour If the 'Delay' input field value is deleted using backspace or other, block form submission. The same behaviour apply if the delete button is used, as both clear out the value. As triggers with no delay are not processed and would also cause higher triggers to then also not be processed, we do not allow the creation of triggers without a set delay. Triggers when edited individually do not check for impact on any overrides they might have. It is therefore safest not to allow submission of a trigger where the user explicitly unset the value. An explicit 'reset to fallback' feature is possible and would constitute a follow up enhancement. Test plan (based on comment 872): A) 'Administration' > 'Circulation triggers' > 'Add new trigger' for any library/category. Set a Delay, a Notice, and a transport type. B) Select the Delay field's value and clear it via the 'X' clear button. C) Notice 'Submit' is disabled. D) Select the Delay field's value and clear it via the keyboard (Backspace/Delete). Click 'Submit'. E) Notice 'Submit' is disabled. Assisted-by: Claude Opus 5 (Anthropic) Sponsored-by: Glasgow Colleges Library Group Signed-off-by: Nick Clemens Signed-off-by: Pedro Amorim --- .../CirculationTriggers/CirculationTriggersFormAdd.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue index fe672e2d6e..ef47ece3ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue @@ -550,6 +550,15 @@ export default { this.setAllowSubmission(); }, setAllowSubmission() { + // the number input yields "" when cleared from the keyboard and null when + // cleared with the button; a trigger with no delay is never processed + const delay = + this.ruleSetToSubmit?.[`overdue_${this.triggerNumber}_delay`]; + if (delay === "" || delay == null) { + this.allowSubmission = false; + return; + } + // if notice is set to "", this translates to 'No letter', for which submission is allowed, and mtt is redundant const noticeAllowSubmissionAndBypassMtt = this.ruleSetToSubmit?.[