Koha-clms/misc/maintenance
Marcel de Rooy ac54d831df Bug 19452: [17.05.x] Remove the truncate option
The truncate option is not really useful. Its result is probably not what
most users of this script expect or need.
It truncates both tables borrower_message_preferences and
borrower_message_transport_preferences. This (unfortunately) includes
deleting messaging preferences for patron categories. After that, adding
preferences again will not add categories again, but only borrower
preferences which are all disabled.

Furthermore, we do not need to disable the foreign key check. Neither
do we actually need to truncate, deleting records seems sufficient.
Also deleting transport preferences is not needed, since it will be
done by a cascade from messaging preferences. Note that the subsequent
call of SetMessagingPreferencesFromDefaults will already delete the
records.

This makes it possible to remove the truncate option altogether.

Test plan:
[1] Select a patron category (say ST) and change days_in_advance to x.
[2] Select a ST patron and set days_advance to y in his msg prefs.
[3] Run borrowers-force-messaging-defaults.pl -doit
[4] Verify that the patron has been reset to the default prefs (incl.
    value x in days_in_advance).
[5] Verify that the patron category prefs are still intact.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2018-03-27 10:48:37 +02:00
..
UNIMARC_fix_collectiontitle.pl
…
UNIMARC_sync_date_created_with_marc_biblio.pl Bug 9192: let UNIMARC_sync_date_created_with_marc_biblio.pl create fields if needed 2013-10-23 14:20:14 +00:00
auth_show_hidden_data.pl Bug 18811: Add a script for checking authority data in hidden fields 2017-10-23 15:32:14 +02:00
borrowers-force-messaging-defaults Bug 19452: [17.05.x] Remove the truncate option 2018-03-27 10:48:37 +02:00
check_sysprefs.sh
…
cmp_sysprefs.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
fix_accountlines_date.pl Bug 14998: Restore previous behavior 2015-11-11 11:07:27 -03:00
fix_accountlines_rmdupfines_bug8253.pl Bug 14870: (followup) Remove superfluous C4::Dates from fix_accountlines_rmdupfines_bug8253.pl 2015-11-19 13:05:06 -03:00
fix_mysql_constraints.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
make_zebra_dom_cfg_from_record_abs Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
process_record_through_filter.pl
…
remove_items_from_biblioitems.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
sanitize_records.pl Bug 17196: Update POD of sanitise_records.pl 2017-01-13 13:49:28 +00:00
touch_all_biblios.pl Bug 19190: Silly calculation of average time in touch_all scripts 2017-12-11 16:50:53 +01:00
touch_all_items.pl Bug 19190: [Follow-up] Do not rely on the return of ModItem 2017-12-11 16:52:16 +01:00