From d56976e9a640a5ffbc36e0ae331b31ae414ef958 Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Thu, 9 Apr 2026 10:01:38 +0000 Subject: [PATCH] Bug 42318: Populate record_sources with system defined values on install This patch adds predefined values to the record_sources table on installation of a new Koha instance. The values are - batchmod - intranet - batchimport - z3950 - bulkmarcimport - import_lexile and were formerly hardcoded in marc-overlay-rules.tt. This was introduced in 35380 which took care of updated instances via a db_revs script but forgot installation scripts. Testplan a) start up a fresh ktd b) login and check go to Administration -> Record sources c) check that no source exists d) apply patch e) go to mysql shell 'koha-mysql kohadev' f) empty the database to trigger Kohas installer: 'drop database koha_kohadev;' followed by a 'create database koha_kohadev;' g) restart_all h) open Koha in browser again, the web installer should appear now. Credentials are 'koha_kohadev' with pasword 'password'. i) run through the installation and create an admin user, j) login with that user and repeat b) and c) k) check that record sources are now set with the values from the descriptioni above. Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass --- C4/Installer.pm | 1 + installer/data/mysql/mandatory/record_sources.sql | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 installer/data/mysql/mandatory/record_sources.sql diff --git a/C4/Installer.pm b/C4/Installer.pm index 1391ed791d..50bbd550c7 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -388,6 +388,7 @@ sub load_sql_in_order { push @fnames, "$global_mandatory_dir/userflags.sql", "$global_mandatory_dir/userpermissions.sql", "$global_mandatory_dir/audio_alerts.sql", + "$global_mandatory_dir/record_sources.sql", ; my $localization_file = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/localization/$langchoice/custom.sql"; diff --git a/installer/data/mysql/mandatory/record_sources.sql b/installer/data/mysql/mandatory/record_sources.sql new file mode 100644 index 0000000000..e7a25409c8 --- /dev/null +++ b/installer/data/mysql/mandatory/record_sources.sql @@ -0,0 +1,7 @@ +INSERT IGNORE INTO record_sources ( name, can_be_edited, is_system ) VALUES +('batchmod', 1, 1 ), +('intranet', 1, 1 ), +('batchimport', 1, 1 ), +('z3950', 1, 1 ), +('bulkmarcimport', 1, 1 ), +('import_lexile', 1, 1 ); \ No newline at end of file