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 <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jan Kissig 2026-04-09 10:01:38 +00:00 committed by Lucas Gass
parent 5e44515ec3
commit d56976e9a6
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 8 additions and 0 deletions

View File

@ -388,6 +388,7 @@ sub load_sql_in_order {
push @fnames, "$global_mandatory_dir/userflags.sql", push @fnames, "$global_mandatory_dir/userflags.sql",
"$global_mandatory_dir/userpermissions.sql", "$global_mandatory_dir/userpermissions.sql",
"$global_mandatory_dir/audio_alerts.sql", "$global_mandatory_dir/audio_alerts.sql",
"$global_mandatory_dir/record_sources.sql",
; ;
my $localization_file = my $localization_file =
C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/localization/$langchoice/custom.sql"; C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/localization/$langchoice/custom.sql";

View File

@ -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 );