Koha-clms/misc/maintenance
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
..
UNIMARC_fix_collectiontitle.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
UNIMARC_sync_date_created_with_marc_biblio.pl Bug 39325: Manual fixes 2025-04-28 18:51:23 +02:00
acq_cancel_obsolete_orders.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
audit_database.pl Bug 36039: (QA follow-up): Improve audit messages 2024-12-27 15:19:05 +01:00
auth_show_hidden_data.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
borrowers-force-messaging-defaults.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_syspref_cache.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_sysprefs.sh
…
cmp_sysprefs.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
compare_es_to_db.pl Bug 39636: Update curl link 2025-10-14 14:52:00 -06:00
dedup_authorities.pl Bug 41097: (QA follow-up) Clarify POD 2026-02-25 07:37:04 -07:00
fix_accountlines_date.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
fix_accountlines_rmdupfines_bug8253.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
fix_invalid_dates.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
fix_mysql_constraints.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
fix_tags_weight.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
generate_MARC21Languages.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
make_zebra_dom_cfg_from_record_abs Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
migrate_action_logs_to_json.pl Bug 41358: Apply consistent JSON logging to holds (Bug 40866) 2026-07-16 10:54:22 +00:00
process_record_through_filter.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
pseudonymize_statistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
remove_items_from_biblioitems.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
sanitize_records.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
search_for_data_inconsistencies.pl Bug 42640: Script search_for_data_inconsistencies.pl use binmode UTF-8 2026-06-23 16:26:38 +00:00
sync_db_comments.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
touch_all_biblios.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
touch_all_items.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
update_authorities.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
update_localuse_from_statistics.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00