Bugzilla – Attachment 182862 Details for
Bug 40037
Redundant check in `notices_content` hook handling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40037: Remove redundant check in `notices_content` hook handling
Bug-40037-Remove-redundant-check-in-noticescontent.patch (text/plain), 1.83 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-05-30 14:42:28 UTC
(
hide
)
Description:
Bug 40037: Remove redundant check in `notices_content` hook handling
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-05-30 14:42:28 UTC
Size:
1.83 KB
patch
obsolete
>From 72b4059741b9d477753a3f7cd992ec675098b6c9 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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 <tomascohen@theke.io> >--- > C4/Letters.pm | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 87c71d16d1c..c90f335f2b4 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.49.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 40037
:
182862
|
182863
|
182864
|
182865