From 6ec821f5703e4d696ebdc8825859a9198eb2fe0a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 30 May 2025 11:35:51 -0300 Subject: [PATCH] Bug 40037: Remove redundant check in `notices_content` hook handling I reused an implemented hook in C4::Letters and overlooked the redundancy in it. This patch clears that. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Plugins/Notices_content_hook.t => SUCCESS: Tests pass 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! No behavior change! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind --- C4/Letters.pm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 87c71d16d1..c90f335f2b 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -631,18 +631,16 @@ sub GetPreparedLetter { } ); - if (@plugins) { - foreach my $plugin (@plugins) { - my $namespace = $plugin->get_metadata()->{namespace}; - if ($namespace) { - try { - if ( my $content = $plugin->notices_content( \%params ) ) { - $objects->{plugin_content}->{$namespace} = $content; - } - } catch { - next; - }; - } + foreach my $plugin (@plugins) { + my $namespace = $plugin->get_metadata()->{namespace}; + if ($namespace) { + try { + if ( my $content = $plugin->notices_content( \%params ) ) { + $objects->{plugin_content}->{$namespace} = $content; + } + } catch { + next; + }; } } } -- 2.39.5