Bug 21651: Always insert notice templates related tables
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 24 Oct 2018 20:02:39 +0000 (17:02 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 30 May 2019 19:23:15 +0000 (20:23 +0100)
The 3 following files must be mandatory and insert during the install process:
- message_transport_types.sql
- sample_notices_message_attributes.sql
- sample_notices_message_transports.sql

They insert data for
- message_transport_types
- message_attributes
- message_transport_type

Otherwise the notice templates (table letter) will fail.

Moreover these 3 files are identical and are put in several places (1 per language)
to make the description translatable (using the related .txt file)

Test plan:
- Install Koha in English and in another language
- Select all the sample data
=> They all should be inserted correctly

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 990cc79ef085b74764cd68875fc0fd6dc6da8ffe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Installer.pm

index 4d57715..b62f843 100644 (file)
@@ -314,15 +314,19 @@ sub load_sql_in_order {
     $request->execute;
     my ($systempreference) = $request->fetchrow;
     $systempreference = '' unless defined $systempreference; # avoid warning
-    # Make sure subtag_registry.sql is loaded second
-    my $subtag_registry = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory/subtag_registry.sql";
-    unshift(@fnames, $subtag_registry);
-    # Make sure authorised value categories are loaded at the beginning
-    my $av_cat = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory/auth_val_cat.sql";
-    unshift(@fnames, $av_cat);
-    # Make sure the global sysprefs.sql file is loaded first
-    my $globalsysprefs = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql";
-    unshift(@fnames, $globalsysprefs);
+
+    my $global_mandatory_dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory";
+
+    # Make sure some stuffs are loaded first
+    unshift(@fnames, C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql");
+    unshift(@fnames,
+        "$global_mandatory_dir/subtag_registry.sql",
+        "$global_mandatory_dir/auth_val_cat.sql",
+        "$global_mandatory_dir/message_transport_types.sql",
+        "$global_mandatory_dir/sample_notices_message_attributes.sql",
+        "$global_mandatory_dir/sample_notices_message_transports.sql",
+    );
+
     push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/userflags.sql";
     push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/userpermissions.sql";
     push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/audio_alerts.sql";