Koha-clms/misc/maintenance
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
..
UNIMARC_fix_collectiontitle.pl Bug 28617: Remove kohalib.pl and rely on PERL5LIB 2021-12-07 12:16:28 -10:00
UNIMARC_sync_date_created_with_marc_biblio.pl Bug 37791: (follow-up) Last occurence 2024-10-11 12:21:30 +02:00
acq_cancel_obsolete_orders.pl Bug 36068: (QA follow-up) Add OPTIONS section in POD 2024-04-19 18:06:31 +02:00
audit_database.pl Bug 36039: (QA follow-up): Improve audit messages 2025-03-19 23:57:33 +01:00
auth_show_hidden_data.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
borrowers-force-messaging-defaults.pl Bug 33239: (QA follow-up) Tidy and improve description 2023-10-11 10:31:46 -03:00
check_syspref_cache.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
check_sysprefs.sh
…
cmp_sysprefs.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
compare_es_to_db.pl Bug 38762: Make compare_es_to_db.pl provide links to staff interface 2025-08-04 11:42:46 +02:00
dedup_authorities.pl Bug 13706: Minor tidy/spelling issues 2024-04-26 14:14:54 +02:00
fix_accountlines_date.pl Bug 28617: Remove kohalib.pl and rely on PERL5LIB 2021-12-07 12:16:28 -10:00
fix_accountlines_rmdupfines_bug8253.pl Bug 28617: Remove kohalib.pl and rely on PERL5LIB 2021-12-07 12:16:28 -10:00
fix_invalid_dates.pl Bug 38857: Update cronjobs to log run before processing parameters 2025-04-22 23:01:33 +02:00
fix_mysql_constraints.pl Bug 28617: Remove kohalib.pl and rely on PERL5LIB 2021-12-07 12:16:28 -10:00
fix_tags_weight.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
generate_MARC21Languages.pl Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
make_zebra_dom_cfg_from_record_abs Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
process_record_through_filter.pl Bug 37791: (follow-up) Last occurence 2024-10-11 12:21:30 +02:00
pseudonymize_statistics.pl Bug 39301: pseudonymize_statistics.pl script generates too many background jobs 2025-08-08 16:58:29 +02:00
remove_items_from_biblioitems.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
sanitize_records.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
search_for_data_inconsistencies.pl Bug 40109: Fix path for fix_invalid_dates.pl in hint from search_for_data_inconsistencies.pl 2025-07-25 15:40:54 +02:00
sync_db_comments.pl Bug 32334: Fix spelling 2023-04-12 11:22:04 -03:00
touch_all_biblios.pl Bug 37037: (RM follow-up) Add hint at end of script run 2024-06-13 13:40:06 +01:00
touch_all_items.pl Bug 28617: Remove kohalib.pl and rely on PERL5LIB 2021-12-07 12:16:28 -10:00
update_authorities.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
update_localuse_from_statistics.pl Bug 37790: Add skip indexing and holds queue options and verbosity to update localuse script 2024-11-18 17:04:32 +01:00