Koha-clms/misc
Martin Renvoize 5427ec07f9
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: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 661c023dcc)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
2026-09-11 12:53:53 +00:00
..
admin Bug 40545: (follow-up) Correct GNU link 2025-10-15 16:12:02 -06:00
bin Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
cronjobs Bug 40225: Send stockrotation report even when all items are stationary 2026-08-11 13:56:33 +00:00
devel Bug 38549: Provide surname for create_superlibrarian.pl 2026-04-13 09:31:03 +01:00
interface_customization
…
maintenance Bug 41358: Apply consistent JSON logging to holds (Bug 40866) 2026-09-11 12:53:53 +00:00
migration_tools Bug 28528: (QA follow-up) Remove "Koha 3" reference 2026-04-13 08:43:55 +01:00
release_notes Update release notes for 25.11.08 release 2026-08-25 15:36:50 +00:00
search_tools Bug 40722: Add a log when resetting mappings during elastic rebuild 2025-10-15 16:12:07 -06:00
translator Bug 41216: (QA follow-up): fix path of xt/author/tt_valid.t in comment 2026-05-24 13:42:17 +01:00
workers Bug 40820: (follow-up) es_indexer_daemon.pl missed on 34070 2025-09-26 10:36:58 -06:00
add_date_fields_to_marc_records.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
add_statistics_borrowers_categorycode.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchCompareMARCvsFrameworks.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchDeleteUnusedSubfields.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
batchImportMARCWithBiblionumbers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRebuildBiblioTables.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRebuildItemsTables.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchRepairMissingBiblionumbers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
batchdeletebiblios.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_sysprefs.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
commit_file.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
export_borrowers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
export_records.pl Bug 41494: Rename "Koha administration" module name to "Administration" 2026-02-03 12:03:45 +00:00
import_patrons.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
koha-install-log
…
link_bibs_to_authorities.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
load_yaml.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
mod_zebraqueue.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
process_ill_updates.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
recreateIssueStatistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
sax_parser_print.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
sax_parser_test.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
sip_cli_emulator.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
stage_file.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950_responder.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00