This patch skips record indexing and real time holds queue updates when updating the localuse field
from statistics. A note is added to the script that the user should reindex if the localuse field is mapped.
Additionally a verbose option is added to the script, and doubled use of GetOptions is removed.
Lastly, a check is added to confirm the items value is being changed before the value is stored.
To test:
1 - Enable the real time holds queue
2 - Enable Elasticsearch
3 - perl misc/maintenance/update_localuse_from_statistics.pl --confirm
4 - Note all items are touched and reported
5 - Check the background jobs table - there are many jobs generated
6 - Apply patch
7 - perl misc/maintenance/update_localuse_from_statistics.pl --confirm
8 - Note 0 items are reported updated, no new background jobs
9 - perl misc/maintenance/update_localuse_from_statistics.pl --confirm --verbose
10 - No items reported
11 - Update some items in the DB
UPDATE items SET localuse = 99 WHERE itemnumber LIKE '%9';
12 - perl misc/maintenance/update_localuse_from_statistics.pl --confirm
13 - Only the number of items changed above reported
14 - UPDATE items SET localuse = 99 WHERE itemnumber LIKE '%9';
15 - perl misc/maintenance/update_localuse_from_statistics.pl --confirm --verbose
16 - Each item changed reported, and the amounts, and the total items updated.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| UNIMARC_fix_collectiontitle.pl | ||
| UNIMARC_sync_date_created_with_marc_biblio.pl | ||
| acq_cancel_obsolete_orders.pl | ||
| audit_database.pl | ||
| auth_show_hidden_data.pl | ||
| borrowers-force-messaging-defaults.pl | ||
| check_syspref_cache.pl | ||
| check_sysprefs.sh | ||
| cmp_sysprefs.pl | ||
| compare_es_to_db.pl | ||
| dedup_authorities.pl | ||
| fix_accountlines_date.pl | ||
| fix_accountlines_rmdupfines_bug8253.pl | ||
| fix_invalid_dates.pl | ||
| fix_mysql_constraints.pl | ||
| fix_tags_weight.pl | ||
| generate_MARC21Languages.pl | ||
| make_zebra_dom_cfg_from_record_abs | ||
| process_record_through_filter.pl | ||
| pseudonymize_statistics.pl | ||
| remove_items_from_biblioitems.pl | ||
| sanitize_records.pl | ||
| search_for_data_inconsistencies.pl | ||
| sync_db_comments.pl | ||
| touch_all_biblios.pl | ||
| touch_all_items.pl | ||
| update_authorities.pl | ||
| update_localuse_from_statistics.pl | ||