Koha-clms/tools
Martin Renvoize 04381f6aba
Bug 41358: Apply consistent JSON logging to holds (Bug 40866)
Bug 40866 introduced JSON logging for HOLDS CREATE but stored null for
'confirmations' and 'forced' when no overrides were present. This patch
mirrors the earlier change to CIRCULATION ISSUE by defaulting them to
empty arrays, keeping the two log streams structurally identical and
simplifying reporting queries.

Changes:

C4/Reserves.pm:
- Default confirmations/forced to [] in the AddReserve log payload.

t/db_dependent/Reserves.t:
- Update the Bug 40866 subtest to assert the empty-array defaults on
  normal holds, and fix a 'my $log_data' redeclaration.

tools/viewlog.pl:
- Extend the CSV export JSON-decode block to also cover HOLDS logs,
  guarding the item lookup on itemnumber being present (HOLDS payloads
  may lack one) and filling the CSV item columns from the decoded
  payload. The legacy bare-itemnumber fallback is restricted to
  CIRCULATION so a legacy HOLDS hold_id is not mistaken for an
  itemnumber.

koha-tmpl/intranet-tmpl/prog/js/viewlog.js:
- Extend the info column override rendering (renderCircInfo) to HOLDS
  entries so forced/confirmations arrays display translated, exactly as
  they do for CIRCULATION. The log viewer moved to an ajax datatable in
  bug 29016, so this replaces the earlier json_found change to
  viewlog.pl/viewlog.tt.

misc/maintenance/migrate_action_logs_to_json.pl:
- Extended to handle legacy pre-Bug 40866 HOLDS CREATE logs where info
  is a bare hold_id, recovering branchcode / biblionumber / itemnumber
  from old_reserves / reserves.
- Uses the same keyset-pagination pattern as the circulation loop so
  rows are not skipped under --commit.

Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-07-16 10:54:22 +00:00
..
csv-profiles MT2116: Addons to the CSV export 2010-02-17 07:51:33 -05:00
access_files.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
additional-contents.pl Bug 41614: available options template params also needed for op=list 2026-03-24 07:48:24 +01:00
ajax-inventory.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
automatic_item_modification_by_age.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
batchMod.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
batch_delete_records.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
batch_extend_due_dates.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
batch_modify_holds.pl Bug 41882: Enforce pickup location rules 2026-04-29 09:09:20 -06:00
batch_record_modification.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
batch_records_ajax.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
cleanborrowers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
copy-holidays.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
csv-profiles.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
exceptionHolidays.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
export.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
holidays.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
import_borrowers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
inventory.pl Bug 38946: Add enumchron to inventory table 2026-02-27 11:38:33 -07:00
letter.pl Bug 40659: (follow-up) include substitutions in the possible options for template 2026-04-23 16:04:12 -06:00
manage-marc-import.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
marc_modification_templates.pl Bug 16994: Import and export MARC modification templates 2026-04-17 09:18:16 -06:00
modborrowers.pl Bug 40843: Sort patron attributes by description 2025-11-19 12:28:16 -07:00
newHolidays.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
overduerules.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
page.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
picture-upload.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
problem-reports.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
quotes-upload.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
quotes.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
restore-records.pl Bug 17387: (follow-up) move records_restore under editcatalogue permission 2026-04-15 14:10:27 -06:00
scheduler.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
showdiffmarc.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
stage-marc-import.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
stockrotation.pl Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
tools-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
upload-cover-image.pl Bug 8088: (follow-up) Tidy 2026-04-15 14:10:15 -06:00
upload-file.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
upload.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
viewlog.pl Bug 41358: Apply consistent JSON logging to holds (Bug 40866) 2026-07-16 10:54:22 +00:00