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>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 17d02662c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Tomas Cohen Arazi 2025-05-30 11:35:51 -03:00 committed by Paul Derscheid
parent 3d8a10a53b
commit 1a93081bf2
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 10 additions and 12 deletions

View File

@ -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;
};
}
}
}