Bug 41425 - Log entries for merging patrons are untranslatable
Summary: Log entries for merging patrons are untranslatable
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 22632
Blocks:
  Show dependency treegraph
 
Reported: 2025-12-10 17:01 UTC by Katrin Fischer
Modified: 2026-02-04 21:00 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: Sponsored
Comma delimited list of Sponsors: Athens County Public Libraries
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This changes the way information is logged during patron merges. Instead of building an English sentence to store in the log (example: Bob Singleton (23529000695412) has been merged into Bobbie Middleton (23529000080862)), it now stores JSON containing information about the patron record and the record which it is being merged with (example: Edna Acosta (23529001000463) merged into Jordan Alford (23529000050113)). The JSON information is accessible using reports.
Version(s) released in:
Circulation function:


Attachments
Bug 41425: Log entries for merging patrons are untranslatable (6.30 KB, patch)
2026-01-06 19:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41425: Log entries for merging patrons are untranslatable (6.34 KB, patch)
2026-01-07 20:11 UTC, David Nind
Details | Diff | Splinter Review
Bug 41425: Log entries for merging patrons are untranslatable (6.60 KB, patch)
2026-01-28 17:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41425: Log entries for merging patrons are untranslatable (6.83 KB, patch)
2026-02-04 17:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41425: Log entries for merging patrons are untranslatable (6.87 KB, patch)
2026-02-04 20:56 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2025-12-10 17:01:49 UTC
Koha/Patron.pm:                        . " has been merged into "

We should never hardcode strings into .pm, they are not translatable. This should be solved on template level instead.
Comment 1 Owen Leonard 2026-01-06 19:28:02 UTC Comment hidden (obsolete)
Comment 2 David Nind 2026-01-07 20:11:46 UTC Comment hidden (obsolete)
Comment 3 David Nind 2026-01-07 20:16:08 UTC
I've signed off, but I noted that any previous patron merges now don't have any meaningful information in info column:

1. Patron merges after the patch display fine. Example: "Edna Acosta (5)" (linked to patron record) in object column, "Jordan Alford (23529000050113) merged into Edna Acosta (23529001000463)" in the info column.

2. Patron merges made before the patch now show as empty. Example: "Bob Singleton (38)" (linked to patron record) in object column, "() merged into ()" in the info column.
Comment 4 Owen Leonard 2026-01-28 17:15:17 UTC Comment hidden (obsolete)
Comment 5 David Nind 2026-01-28 20:10:36 UTC
Changed to Failed QA as the Info message is "() merged into ()", before it was, for example: "Bob Singleton (23529000695412) has been merged into Bobbie Middleton (23529000080862)".
Comment 6 Owen Leonard 2026-02-04 17:09:56 UTC
Created attachment 192474 [details] [review]
Bug 41425: Log entries for merging patrons are untranslatable

This patch changes the way information is logged during patron merges.
Instead of building an English sentence to be stored in the log now it
stores JSON containing information about the patron record and the
record which it is being merged with.

To test, apply the patch and restart_services.

- If necessary, go to Administration -> System preferences -> Logs and
  enable BorrowersLog.
- Perform a patron search which will return more than one result.
- Check the box next to two or more results and click "Merge selected
  patrons" in the toolbar.
- Select one of the patron records to be merged with and click "Merge
  patrons."
- Go to Tools -> Log viewer and perform a search limited to the
  patron module with "Display from" and "Display to" set to today.
- You should see an entry for the patron merge you performed, with the
  updated patron linked in the "Object" column and information about the
  merge in the "Info" column, e.g. "John Smith (12345) merged with John
  Smith (45678).

Sponsored-by: Athens County Public Libraries
Comment 7 Owen Leonard 2026-02-04 17:12:00 UTC
(In reply to David Nind from comment #5)
> Changed to Failed QA as the Info message is "() merged into ()"

I've modified the patch to account for log messages which were previously saved as well as new messages which are stored differently. Previously saved log messages will still be untranslated.
Comment 8 David Nind 2026-02-04 20:56:44 UTC
Created attachment 192503 [details] [review]
Bug 41425: Log entries for merging patrons are untranslatable

This patch changes the way information is logged during patron merges.
Instead of building an English sentence to be stored in the log now it
stores JSON containing information about the patron record and the
record which it is being merged with.

To test, apply the patch and restart_services.

- If necessary, go to Administration -> System preferences -> Logs and
  enable BorrowersLog.
- Perform a patron search which will return more than one result.
- Check the box next to two or more results and click "Merge selected
  patrons" in the toolbar.
- Select one of the patron records to be merged with and click "Merge
  patrons."
- Go to Tools -> Log viewer and perform a search limited to the
  patron module with "Display from" and "Display to" set to today.
- You should see an entry for the patron merge you performed, with the
  updated patron linked in the "Object" column and information about the
  merge in the "Info" column, e.g. "John Smith (12345) merged with John
  Smith (45678).

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2026-02-04 21:00:53 UTC
(In reply to Owen Leonard from comment #7)
> (In reply to David Nind from comment #5)
> > Changed to Failed QA as the Info message is "() merged into ()"
> 
> I've modified the patch to account for log messages which were previously
> saved as well as new messages which are stored differently. Previously saved
> log messages will still be untranslated.

Thanks Owen!