From 3a744c68037df7cd14b34c403a0484365f2aba57 Mon Sep 17 00:00:00 2001
From: Martin Renvoize
Date: Fri, 27 Feb 2026 05:49:34 +0000
Subject: [PATCH] Bug 10190: (QA follow-up) Fix six issues reported during QA
1. Letter context: setFilteredLetters() was reading library_id from
currentRuleSet (which has no top-level library_id property) instead
of this.context.library_id, causing library-specific letter templates
to never match.
2. False conflict on edit: conflict check fetched rule set from DB with
effective=false (raw), but the in-memory snapshot was fetched with
effective=true (with fallbacks). Comparing raw vs effective always
triggered a conflict when a context inherited any value from a more
general rule. Fixed by using effective=true for the DB fetch too.
3. Incomplete deletion: updateCircRuleSets() inside deleteRuleSet() was
called without await, creating a race condition where the page refresh
could complete before the deletion API call, leaving stale data visible.
Also added a guard to skip rule sets with no explicit rules for the
trigger being deleted, and simplified rulesForDeletion construction.
4. No rules displayed on initial load: the route watcher in
CirculationTriggersList fired immediately before init() had loaded
patron categories and item types, causing setAllExhaustiveEffectiveRuleSets()
to produce an empty result. Fixed with a metaInitialized flag that the
watcher waits for before proceeding.
5. DefaultToLoggedInLibraryOverdueTriggers syspref not respected: the
default_view template variable was computed but never applied to the
store's currentLibraryId. Fixed by passing it to init().
6. UI colors: info box background changed from #84c1f3 to #DAECFB (lighter,
matching the circulation rules page). Error alert messages changed from
alert-info (blue) to alert-warning (yellow) to match Koha conventions.
---
.../CirculationTriggersFormAdd.vue | 9 ++++--
.../CirculationTriggersFormConfirmReset.vue | 2 +-
...lationTriggersFormConfirmTriggerDelete.vue | 2 +-
.../CirculationTriggersList.vue | 15 +++++++++
.../Admin/CirculationTriggers/Main.vue | 6 +++-
.../prog/js/vue/stores/circulation-rules.js | 32 +++++++++----------
6 files changed, 44 insertions(+), 22 deletions(-)
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 ddc0f4fcda5..5ceaf3c7788 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
@@ -126,7 +126,7 @@