Bugzilla – Attachment 159058 Details for
Bug 33268
Overlay rules don't work correctly when source is set to *
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33268: Add tests for context module priority
Bug-33268-Add-tests-for-context-module-priority.patch (text/plain), 3.44 KB, created by
David Gustafsson
on 2023-11-16 17:24:56 UTC
(
hide
)
Description:
Bug 33268: Add tests for context module priority
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2023-11-16 17:24:56 UTC
Size:
3.44 KB
patch
obsolete
>From 4b17b021f7c7465b4f3bd4bdc455afe370f9448a Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Thu, 16 Nov 2023 18:24:07 +0100 >Subject: [PATCH] Bug 33268: Add tests for context module priority > >--- > t/db_dependent/Biblio/MarcOverlayRules.t | 65 +++++++++++++++++++++++- > 1 file changed, 64 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Biblio/MarcOverlayRules.t b/t/db_dependent/Biblio/MarcOverlayRules.t >index 4156907645a..7bd42493204 100755 >--- a/t/db_dependent/Biblio/MarcOverlayRules.t >+++ b/t/db_dependent/Biblio/MarcOverlayRules.t >@@ -684,7 +684,7 @@ $skip_all_rule->delete(); > > # Test module filter specificity > subtest 'Module filter precedence tests' => sub { >- plan tests => 7; >+ plan tests => 9; > > $rule->set( > { >@@ -868,6 +868,69 @@ subtest 'Module filter precedence tests' => sub { > 'Wildcard filter rules with tags with tag regexps matching the same tag as regexps for non wildcard filter rules has been overridden' > ); > >+ my $categorycode_matching_filter_rule_protect = Koha::MarcOverlayRules->find_or_create( >+ { >+ tag => '*', >+ module => 'categorycode', >+ filter => 'C', >+ add => 0, >+ append => 0, >+ remove => 0, >+ delete => 0 >+ } >+ ); >+ >+ # Current rules: >+ # source: *, tag: *, add: 0, append: 0, remove: 0, delete: 0 >+ # source: *, tag: 5\d{2}, add: 1, append: 1, remove: 1, delete: 1 >+ # source: test, tag: 250, add: 1, append: 1, remove: 1, delete: 1 >+ # source: test, tag: 5\d{2}, add: 0, append: 0, remove: 0, delete: 0 >+ # categorycode: C, tag: *, add: 0, append: 0, remove: 0, delete: 0 >+ $merged_record = Koha::MarcOverlayRules->merge_records( >+ $orig_record, >+ $incoming_record, >+ { 'source' => 'test', 'categorycode' => 'C' } >+ ); >+ >+ is( >+ $merged_record->as_formatted, >+ $orig_record->as_formatted, >+ 'If both categorycode and source module contexts matches, rules from categorycode module context are used' >+ ); >+ >+ my $userid_matching_filter_rule_protect = Koha::MarcOverlayRules->find_or_create( >+ { >+ tag => '*', >+ module => 'userid', >+ filter => '123', >+ add => 1, >+ append => 1, >+ remove => 1, >+ delete => 1 >+ } >+ ); >+ >+ # Current rules: >+ # source: *, tag: *, add: 0, append: 0, remove: 0, delete: 0 >+ # source: *, tag: 5\d{2}, add: 1, append: 1, remove: 1, delete: 1 >+ # source: test, tag: 250, add: 1, append: 1, remove: 1, delete: 1 >+ # source: test, tag: 5\d{2}, add: 0, append: 0, remove: 0, delete: 0 >+ # categorycode: C, tag: *, add: 0, append: 0, remove: 0, delete: 0 >+ # userid: 123, tag: *, add: 1, append: 1, remove: 1, delete: 1 >+ $merged_record = Koha::MarcOverlayRules->merge_records( >+ $orig_record, >+ $incoming_record, >+ { 'source' => 'test', 'categorycode' => 'C', 'userid' => '123' } >+ ); >+ >+ is( >+ $merged_record->as_formatted, >+ $incoming_record->as_formatted, >+ 'If both userid, categorycode and source module contexts matches, rules from userid module context are used' >+ ); >+ >+ $categorycode_matching_filter_rule_protect->delete(); >+ $userid_matching_filter_rule_protect->delete(); > $wildcard_filter_rule_overwrite->delete(); > $matching_filter_rule_overwrite->delete(); > $matching_filter_rule_protect->delete(); >-- >2.42.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 33268
:
158956
|
159004
|
159058
|
159160
|
159161
|
159518
|
159519
|
160017
|
160018
|
162764
|
162766
|
162767
|
162785
|
162786
|
162796
|
162797
|
162798
|
162799
|
162800
|
162801
|
162802
|
162803
|
162804
|
162805
|
162936
|
162937
|
162938
|
162939
|
162940