From 2a618478b4bb99c55bdf7f84cd7e5fd99dccc51e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 May 2024 12:58:33 +0200 Subject: [PATCH] Bug 36790: List table columns for 230600052 queries We must list the columns, or the db rev will fail when a new column is added. It happened here when 33478 added 'style' Also remove id and dates --- admin/preferences.pl | 14 +++++++------- installer/data/mysql/db_revs/230600052.pl | 10 +++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/admin/preferences.pl b/admin/preferences.pl index 6c2bd49c626..22abea704bf 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -161,21 +161,21 @@ sub _get_chunk { } keys %{ $options{multiple} } ]; - } elsif ( $options{'multiple_sortable'} ) { + } + elsif ( $options{'multiple_sortable'} ) { my @values; - @values = split /,/, $value if defined($value); - $chunk->{type} = 'multiple_sortable'; + @values = split /,/, $value if defined($value); + $chunk->{type} = 'multiple_sortable'; my @options = sort keys %{ $options{multiple_sortable} }; $chunk->{CHOICES} = [ - map { + map { my $option_value = $_; { text => $options{multiple_sortable}->{$option_value}, value => $option_value, - selected => (grep { $_ eq $option_value } @values) ? 1 : 0, + selected => ( grep { $_ eq $option_value } @values ) ? 1 : 0, } - } - uniq(@values, @options) + } uniq( @values, @options ) ]; } diff --git a/installer/data/mysql/db_revs/230600052.pl b/installer/data/mysql/db_revs/230600052.pl index 416e30d42ec..5687d9040b4 100755 --- a/installer/data/mysql/db_revs/230600052.pl +++ b/installer/data/mysql/db_revs/230600052.pl @@ -9,7 +9,8 @@ return { $dbh->do( q{ - INSERT IGNORE INTO `letter` VALUES (NULL,'reserves','HOLDDGST','','Hold available for pickup (digest)',0,'Hold(s) available for pickup','You have one or more holds available for pickup:\r\n\r\n----\r\nTitle: [% hold.biblio.title %]\r\nAuthor: [% hold.biblio.author %]\r\nCopy: [% hold.item.copynumber %]\r\nLocation: [% hold.branch.branchname %]\r\nWaiting since: [% hold.waitingdate %]\r\nWaiting at: [%hold.branch.branchname%]\r\n[% hold.branch.branchaddress1 %]\r\n[% hold.branch.branchaddress2 %]\r\n[% hold.branch.branchaddress3 %]\r\n[% hold.branch.branchcity %] [% hold.branch.branchzip %]\r\n----','email','default','2023-08-29 18:42:15'); + INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) + VALUES ('reserves','HOLDDGST','','Hold available for pickup (digest)',0,'Hold(s) available for pickup','You have one or more holds available for pickup:\r\n\r\n----\r\nTitle: [% hold.biblio.title %]\r\nAuthor: [% hold.biblio.author %]\r\nCopy: [% hold.item.copynumber %]\r\nLocation: [% hold.branch.branchname %]\r\nWaiting since: [% hold.waitingdate %]\r\nWaiting at: [%hold.branch.branchname%]\r\n[% hold.branch.branchaddress1 %]\r\n[% hold.branch.branchaddress2 %]\r\n[% hold.branch.branchaddress3 %]\r\n[% hold.branch.branchcity %] [% hold.branch.branchzip %]\r\n----','email','default'); } ); @@ -17,7 +18,8 @@ return { $dbh->do( q{ - INSERT IGNORE INTO `letter` VALUES (NULL,'reserves','HOLDDGST','','Hold available for pickup (digest)',0,'Hold(s) available for pickup','You have one or more holds available for pickup:\r\n----\r\n[% hold.biblio.title %]\r\n----','sms','default','2023-08-29 18:42:15'); + INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) + VALUES ('reserves','HOLDDGST','','Hold available for pickup (digest)',0,'Hold(s) available for pickup','You have one or more holds available for pickup:\r\n----\r\n[% hold.biblio.title %]\r\n----','sms','default'); } ); @@ -25,7 +27,9 @@ return { $dbh->do( q{ - INSERT IGNORE INTO message_transports VALUES + INSERT IGNORE INTO message_transports + (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`, `branchcode`) + VALUES ( 4, "email", 1, "reserves", "HOLDDGST", "" ), ( 4, "sms", 1, "reserves", "HOLDDGST", "" ), ( 4, "phone", 1, "reserves", "HOLDDGST", ""); -- 2.34.1