Bugzilla – Attachment 162767 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: If rules exists add rules to preserve current behaviour
Bug-33268-If-rules-exists-add-rules-to-preserve-cu.patch (text/plain), 2.16 KB, created by
David Gustafsson
on 2024-03-05 15:58:39 UTC
(
hide
)
Description:
Bug 33268: If rules exists add rules to preserve current behaviour
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2024-03-05 15:58:39 UTC
Size:
2.16 KB
patch
obsolete
>From c8ba11c7c56b65bb6c2b957da04540f4cbf9efb5 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Tue, 5 Mar 2024 16:47:29 +0100 >Subject: [PATCH] Bug 33268: If rules exists add rules to preserve current > behaviour > >--- > ...reserve_current_overlay_rules_behaviour.pl | 30 +++++++++++++++++++ > 1 file changed, 30 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_33268-add_rules_to_preserve_current_overlay_rules_behaviour.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_33268-add_rules_to_preserve_current_overlay_rules_behaviour.pl b/installer/data/mysql/atomicupdate/bug_33268-add_rules_to_preserve_current_overlay_rules_behaviour.pl >new file mode 100755 >index 00000000000..6beab362913 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_33268-add_rules_to_preserve_current_overlay_rules_behaviour.pl >@@ -0,0 +1,30 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "33268", >+ description => "Add rules to preserve current marc record overlay rules behavior", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Insert filter wildcard rules equivalent to the default >+ # fallback rule (overwrite) if wildcard rules exists for a module >+ # and other filter wildcard rule not already defined >+ my @modules = $dbh->selectall_array( q{SELECT DISTINCT `module` FROM `marc_overlay_rules` WHERE `filter` = "*"} ); >+ for my $module ( map { $_->[0] } @modules ) { >+ my @filters = $dbh->selectall_array( >+ q{SELECT DISTINCT `filter` FROM `marc_overlay_rules` WHERE `module` = ? AND `filter` <> "*"}, >+ undef, >+ $module >+ ); >+ for my $filter ( map { $_->[0] } @filters ) { >+ $dbh->do( >+ q{INSERT INTO `marc_overlay_rules`(`tag`, `module`, `filter`, `add`, `append`, `remove`, `delete`) VALUES(?, ?, ?, ?, ?, ?, ?)}, >+ undef, >+ '*', $module, $filter, 1, 1, 1, 1 >+ ); >+ } >+ } >+ say $out "Added record overlay rules to preserve current behavior"; >+ }, >+}; >-- >2.43.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