Bugzilla – Attachment 194087 Details for
Bug 10190
Overdue notice triggers based on item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10190: (QA follow-up) Fix six issues reported during QA
3a744c6.patch (text/plain), 11.22 KB, created by
Martin Renvoize (ashimema)
on 2026-02-27 07:16:40 UTC
(
hide
)
Description:
Bug 10190: (QA follow-up) Fix six issues reported during QA
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-27 07:16:40 UTC
Size:
11.22 KB
patch
obsolete
>From 3a744c68037df7cd14b34c403a0484365f2aba57 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >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 @@ > <p>{{ $__("Loading context...") }}</p> > </div> > <fieldset class="rows" v-if="alertMessage"> >- <div class="alert alert-info">{{ alertMessage }}</div> >+ <div class="alert alert-warning">{{ alertMessage }}</div> > </fieldset> > <fieldset > class="rows" >@@ -601,7 +601,10 @@ export default { > > // in edit mode, check for changes from elsewhere to the rule set being edited > if (this.editMode === "edit") { >- const ruleSetInDb = await this.getSelectedRuleSet(this.context); >+ const ruleSetInDb = await this.getSelectedRuleSet( >+ this.context, >+ true >+ ); > if ( > this.hasConflict( > ruleSetInDb, >@@ -756,7 +759,7 @@ export default { > : Infinity; > }, > setFilteredLetters() { >- const library = this.currentRuleSet.library_id; >+ const library = this.context.library_id; > const byCode = new Map(); > > for (const letter of this.letters) { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue >index 0c1e96286ae..210380e2e3d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmReset.vue >@@ -259,7 +259,7 @@ > </fieldset> > > <fieldset class="rows" v-if="alertMessage"> >- <div class="alert alert-info">{{ alertMessage }}</div> >+ <div class="alert alert-warning">{{ alertMessage }}</div> > </fieldset> > </CirculationTriggersForm> > </template> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue >index 38aa1b8f507..1b2687b20a7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormConfirmTriggerDelete.vue >@@ -33,7 +33,7 @@ > }} > </p> > </div> >- <div class="alert alert-info" v-if="alertMessage"> >+ <div class="alert alert-warning" v-if="alertMessage"> > {{ alertMessage }} > </div> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue >index 6ded9bdcf75..42e2b6c37e0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersList.vue >@@ -352,6 +352,7 @@ export default { > allEffectiveRuleSets, > librariesWithRules, > storeInitialized, >+ metaInitialized, > } = storeToRefs(circRulesStore); > > return { >@@ -372,6 +373,7 @@ export default { > isLastTrigger, > getLibrariesWithRules, > storeInitialized, >+ metaInitialized, > from_branch, > }; > }, >@@ -483,6 +485,19 @@ export default { > this.$route.fullPath.includes("refresh") || > this.$route.path.endsWith("circulation_triggers") > ) { >+ if (!this.metaInitialized) { >+ await new Promise(resolve => { >+ const stop = this.$watch( >+ "metaInitialized", >+ val => { >+ if (val) { >+ stop(); >+ resolve(); >+ } >+ } >+ ); >+ }); >+ } > await this.$nextTick(); > await this.filterRuleSetsbySearchParam(); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/Main.vue >index 8c1b12f4527..69fa7ac272d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/Main.vue >@@ -29,7 +29,7 @@ import { inject } from "vue"; > export default { > setup() { > const circRulesStore = inject("circRulesStore"); >- circRulesStore.init(); >+ circRulesStore.init(default_view); > letters.unshift({ > name: "No letter", > code: "", >@@ -51,6 +51,10 @@ export default { > </script> > > <style> >+.page-section.bg-info { >+ background-color: #DAECFB !important; >+} >+ > form .v-select { > display: inline-block; > background-color: white; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/circulation-rules.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/circulation-rules.js >index 77af0caa186..d5c63b07218 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/circulation-rules.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/circulation-rules.js >@@ -20,6 +20,7 @@ export const useCircRulesStore = defineStore("circRules", () => { > currentPatronCategoryId: null, > currentItemTypeId: null, > triggerCounts: { "*": 0 }, >+ metaInitialized: false, > // references > itemTypes: [], > libraries: [], >@@ -44,10 +45,12 @@ export const useCircRulesStore = defineStore("circRules", () => { > > const actions = { > // controllers >- async init() { >+ async init(defaultLibraryId = "*") { > await this.getItemTypes(); > await this.getLibraries(); > await this.getPatronCategories(); >+ this.currentLibraryId = defaultLibraryId; >+ this.metaInitialized = true; > }, > async loadUserPermissions() { > if (this.userPermissions !== null) { >@@ -390,27 +393,24 @@ export const useCircRulesStore = defineStore("circRules", () => { > }, > // repositories > async deleteRuleSet(ruleSet, triggerNumber) { >+ if (!this.hasExplicitRulesForTrigger(ruleSet, triggerNumber)) { >+ return; >+ } >+ > const ruleSetInDb = await this.getSelectedRuleSet(ruleSet.context); > > if (this.hasConflict(ruleSet, ruleSetInDb, triggerNumber)) { > throw "The rule set for the selected trigger context could not be reset as it was updated elsewhere. Please see the updated trigger above."; > } > >- const rulesForDeletion = { context: ruleSet.context }; >- >- if (ruleSet[`overdue_${triggerNumber}_delay`] !== null) { >- rulesForDeletion[`overdue_${triggerNumber}_delay`] = null; >- } >- if (ruleSet[`overdue_${triggerNumber}_notice`] !== null) { >- rulesForDeletion[`overdue_${triggerNumber}_notice`] = null; >- } >- if (ruleSet[`overdue_${triggerNumber}_restrict`] !== null) { >- rulesForDeletion[`overdue_${triggerNumber}_restrict`] = null; >- } >- if (ruleSet[`overdue_${triggerNumber}_mtt`] !== null) { >- rulesForDeletion[`overdue_${triggerNumber}_mtt`] = null; >- } >- this.updateCircRuleSets(rulesForDeletion, triggerNumber); >+ const rulesForDeletion = { >+ context: ruleSet.context, >+ [`overdue_${triggerNumber}_delay`]: null, >+ [`overdue_${triggerNumber}_notice`]: null, >+ [`overdue_${triggerNumber}_restrict`]: null, >+ [`overdue_${triggerNumber}_mtt`]: null, >+ }; >+ await this.updateCircRuleSets(rulesForDeletion, triggerNumber); > }, > async getLibrariesWithRules() { > const client = APIClient.circRule; >-- >2.53.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10190
:
170357
|
170358
|
170359
|
170360
|
170361
|
170362
|
170363
|
170364
|
170365
|
170366
|
170367
|
170368
|
170369
|
170370
|
170371
|
170372
|
170373
|
170374
|
170375
|
170376
|
170380
|
170449
|
171727
|
171728
|
171729
|
171730
|
171731
|
171732
|
171733
|
171734
|
171735
|
171736
|
171737
|
171738
|
171739
|
171740
|
171741
|
171742
|
171743
|
171744
|
171745
|
171746
|
171747
|
171748
|
171749
|
171750
|
171751
|
171752
|
171753
|
171754
|
171755
|
172588
|
172589
|
172590
|
172591
|
172592
|
172593
|
172594
|
172595
|
172596
|
172597
|
172598
|
172599
|
172600
|
172601
|
172602
|
172603
|
172604
|
172605
|
172606
|
172607
|
172608
|
172609
|
172612
|
172614
|
172617
|
172619
|
172621
|
172622
|
172623
|
172624
|
172625
|
172626
|
172630
|
172631
|
172632
|
172633
|
172634
|
172635
|
172636
|
172637
|
172638
|
172639
|
172640
|
172641
|
172642
|
172643
|
172644
|
172645
|
172646
|
172647
|
172648
|
172649
|
172650
|
172651
|
172652
|
172653
|
172654
|
172655
|
172656
|
172657
|
172658
|
172659
|
172660
|
172661
|
172662
|
172663
|
178643
|
178644
|
178645
|
178646
|
178647
|
178648
|
178649
|
178650
|
178651
|
178652
|
178653
|
178654
|
178655
|
178656
|
178657
|
178658
|
178659
|
178660
|
178661
|
178662
|
178663
|
178664
|
178665
|
178666
|
178667
|
178668
|
178669
|
178670
|
178671
|
178672
|
178673
|
178674
|
178675
|
188075
|
188076
|
188077
|
188078
|
188079
|
188080
|
188081
|
188082
|
188083
|
188084
|
188085
|
188086
|
188087
|
188088
|
188476
|
189345
|
189863
|
189864
|
189865
|
189866
|
189867
|
189868
|
191749
|
191750
|
191751
|
191752
|
191753
|
191754
|
191755
|
191756
|
191757
|
191758
|
191759
|
191760
|
191761
|
191762
|
191763
|
191795
|
191796
|
191805
|
191854
|
191873
|
192871
|
192872
|
192873
|
192874
|
192875
|
192876
|
192877
|
192878
|
192879
|
192880
|
192881
|
192882
|
192883
|
192884
|
192885
|
192886
|
192887
|
192888
|
192889
|
192890
|
192891
|
192892
|
192893
|
192894
|
192895
|
192896
|
192897
|
192898
|
192899
|
193864
|
193866
|
193867
|
193868
|
193869
|
193870
|
193871
|
193872
|
193873
|
193874
|
193875
|
193876
|
193877
|
193878
|
193879
|
193880
|
193881
|
193882
|
193883
|
193884
|
193885
|
193886
|
193887
|
193888
|
193889
|
193890
|
193891
|
193892
|
193893
|
193894
|
193895
|
193896
|
193897
|
193898
|
193899
|
193900
|
193901
|
193902
|
193903
|
193904
|
193905
|
193979
|
194045
|
194046
|
194047
|
194048
|
194049
|
194050
|
194051
|
194052
|
194053
|
194054
|
194055
|
194056
|
194057
|
194058
|
194059
|
194060
|
194061
|
194062
|
194063
|
194064
|
194065
|
194066
|
194067
|
194068
|
194069
|
194070
|
194071
|
194072
|
194073
|
194074
|
194075
|
194076
|
194077
|
194078
|
194079
|
194080
|
194081
|
194082
|
194083
|
194084
|
194085
|
194086
| 194087 |
194088
|
194090
|
194094