Koha/misc
Tomas Cohen Arazi df1f5da673
Bug 36309: Make create_superlibrarian.pl output more useful
In situations in which you are not familiar with all the Koha settings,
and table structure, the fact this script just fails telling there's a
broken FK is just not practical.

We should capture those exceptions and display a useful message instead.

This script does that. It adds some validations and some exception
handling too. It prints a nice message about the bad value the user
passed, and the valid values too!

To test:
1. Run this on a fresh KTD:
   $ ktd --shell
  k$ perl  misc/devel/create_superlibrarian.pl \
      --userid tcohen \
      --password tomasito \
      --cardnumber 123456789 \
      --categorycode POT \
      --branchcode ATO
=> FAIL: It explodes with a MySQL exception message!
2. Apply this patch
3. Repeat 1
=> SUCCESS: It tells you which value is wrong and what values you can
pick to make the command work
4. Pick a valid value, and repeat
=> SUCCESS: Now the other value is wrong, a nice message is displayed!
5. Fix with a valid value and repeat
=> SUCCESS: Patron created!
6. Sign off :-D

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-22 08:57:35 +02:00
..
admin
bin Bug 36031: Remove obsoleted script 2024-04-05 11:51:16 +02:00
cronjobs Bug 23296: Set patron branchcode when preparing non-digest version 2024-04-05 11:51:12 +02:00
devel Bug 36309: Make create_superlibrarian.pl output more useful 2024-04-22 08:57:35 +02:00
interface_customization Bug 23148: Replace Bridge icons with transparent PNG files 2020-07-20 16:16:37 +02:00
maintenance Bug 36068: (QA follow-up) Add OPTIONS section in POD 2024-04-19 18:06:31 +02:00
migration_tools Bug 30349: Add missing double dash (--delete) to POD 2024-03-22 10:35:24 +01:00
release_notes Add release notes for 23.11.0 2023-11-30 16:17:58 -03:00
search_tools
translator Bug 36516: Fix useless warning from translation script 2024-04-05 11:51:19 +02:00
workers Bug 33898: Implement reaping for database polling 2024-03-15 09:38:37 +01: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
batchdeletebiblios.pl
batchDeleteUnusedSubfields.pl
batchImportMARCWithBiblionumbers.pl
batchRebuildBiblioTables.pl
batchRebuildItemsTables.pl
batchRepairMissingBiblionumbers.pl
check_sysprefs.pl
commit_file.pl
export_borrowers.pl
export_records.pl Bug 31286: Embed see-from headings into bibliographic records export 2024-03-25 09:53:24 +01: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 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink 2023-11-03 14:22:45 -03:00
load_yaml.pl
mod_zebraqueue.pl
process_ill_updates.pl
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 34478: op =~ ^cud- in pl/pm - Manual revert changes to sip_cli_emulator.pl 2024-03-01 10:57:14 +01:00
stage_file.pl
z3950_responder.pl