Bug 40037

Summary: Redundant check in `notices_content` hook handling
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 39870, 37869    
Bug Blocks:    
Attachments: Bug 40037: Remove redundant check in `notices_content` hook handling
Bug 40037: (follow-up) Remove redundancy in `before_send_messages`
Bug 40037: Remove redundant check in `notices_content` hook handling
Bug 40037: (follow-up) Remove redundancy in `before_send_messages`

Description Tomás Cohen Arazi (tcohen) 2025-05-30 14:33:17 UTC

    
Comment 1 Tomás Cohen Arazi (tcohen) 2025-05-30 14:42:28 UTC
Created attachment 182862 [details] [review]
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>
Comment 2 Tomás Cohen Arazi (tcohen) 2025-05-30 14:42:31 UTC
Created attachment 182863 [details] [review]
Bug 40037: (follow-up) Remove redundancy in `before_send_messages`

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi (tcohen) 2025-05-30 15:07:17 UTC
I did a grep for `@plugins` on the codebase and these seem to be the only places this pattern was used.
Comment 4 David Nind 2025-05-30 18:20:55 UTC
Created attachment 182864 [details] [review]
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>
Comment 5 David Nind 2025-05-30 18:20:57 UTC
Created attachment 182865 [details] [review]
Bug 40037: (follow-up) Remove redundancy in `before_send_messages`

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>