Koha-clms/misc
Nick Clemens 63e5e10bde
Bug 39301: pseudonymize_statistics.pl script generates too many background jobs
This patch changes the script to use 'Koha::PseudonymizedTransaction->new_from_statistic' directly
rather than calling 'Koha::Statistic->pseudonymize()' which generates a background job.

Additionally, some of the checks from 'pseudonymnize' and the background job are moved into the search
so we don't fetch any to pseudonymize that should not be.

To test:
 1 - Generate some entries in statistics (checkin, checkout, renew, etc)
 2 - Enable pseudonymization (see bug 28911 if you need bcrypt settings)
 3 - perl misc/maintenance/pseudonymize_statistics.pl -v -c
 4 - Statistics pseudonymized
 5 - Check the background jobs table, note jobs were generated
 6 - Apply patch
 7 - perl misc/maintenance/pseudonymize_statistics.pl -v -c
 8 - You get same count as before, and are warned of existing pseudonymized transactions
 9 - enter 'Y' to continue
10 - Check the pseudonymized_transacations table
11 - Confirm same rows were generated twice
12 - Check the background jobs
13 - Confirm there were no new jobs generated (for pseudonymization)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 342c1d5993)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-08-08 16:58:29 +02:00
..
admin Bug 37682: Lazy-load modules for setters in koha-preferences tool 2024-08-27 12:14:23 +02:00
bin Bug 38382: Fresh connection when connexion CSRF token expires 2025-01-30 22:54:47 +01:00
cronjobs Bug 39250: Add archive_purchase_suggestions.pl to cron.daily commented 2025-08-08 10:03:06 +02:00
devel Bug 37448: Add script to allow developers to quickly generate large amounts of data for development and testing 2025-04-22 23:01:38 +02:00
interface_customization
…
maintenance Bug 39301: pseudonymize_statistics.pl script generates too many background jobs 2025-08-08 16:58:29 +02:00
migration_tools Bug 37020: (follow-up): Remove memleak when not using Elasticsearch 2025-05-26 20:17:06 +02:00
release_notes Update release notes for 24.11.07 release 2025-07-24 22:37:36 +02:00
search_tools Bug 35345: Add --where option to rebuild_elasticsearch.pl 2024-04-22 12:39:26 +02:00
translator Bug 38900: Provide info about the problematic strings 2025-08-06 09:57:02 +00:00
workers Bug 34070: Display the 'jobs will be processed anyway' message from worker 2025-08-04 10:29:33 +02:00
add_date_fields_to_marc_records.pl
…
add_statistics_borrowers_categorycode.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
batchCompareMARCvsFrameworks.pl
…
batchDeleteUnusedSubfields.pl
…
batchImportMARCWithBiblionumbers.pl
…
batchRebuildBiblioTables.pl
…
batchRebuildItemsTables.pl Bug 31224: Update instances of metadata->record 2024-11-07 16:29:23 +01:00
batchRepairMissingBiblionumbers.pl
…
batchdeletebiblios.pl
…
check_sysprefs.pl
…
commit_file.pl
…
export_borrowers.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-14 10:46:31 +01:00
export_records.pl Bug 36770: (QA follow-up) Tidy export_records.pl 2024-08-09 18:44:54 +02:00
exportauth.pl
…
import_patrons.pl Bug 34621: Tidy import_patrons.pl 2024-04-12 14:02:43 +02:00
koha-install-log
…
link_bibs_to_authorities.pl Bug 29238: Cataloging cron jobs are not logged 2025-04-22 23:02:26 +02:00
load_yaml.pl
…
mod_zebraqueue.pl
…
process_ill_updates.pl Bug 35581: Koha::Illrequest -> Koha::ILL::Request 2024-04-22 08:57:45 +02:00
recreateIssueStatistics.pl Bug 34478: op =~ ^cud- in pl/pm - Manual revert changes to recreateIssueStatistics.pl 2024-03-01 10:57:15 +01:00
sax_parser_print.pl
…
sax_parser_test.pl
…
sip_cli_emulator.pl Bug 40144: Get rid of `sip_cli_emulator.pl` warnings 2025-07-25 15:43:26 +02:00
stage_file.pl
…
z3950_responder.pl
…