From ed879880d89793509a68a932b7b245393b7f3e0d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 24 Aug 2015 06:46:30 -0400 Subject: [PATCH] Bug 9468: (QA followup) Remove GetSupportList dependency from updatadatabase.pl Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/updatedatabase.pl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2446527432..388d01fbbc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -39,7 +39,6 @@ use C4::Installer; use C4::Dates; use Koha::Database; use Koha; -use C4::Koha qw/GetSupportList/; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); @@ -11321,14 +11320,21 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } -$DBversion = "3.19.00.XXX"; +$DBversion = "3.21.00.XXX"; if ( CheckVersion($DBversion) ) { - foreach my $format (@{ GetSupportList() }) { - $dbh->do(q| + my $query = q{ SELECT * FROM itemtypes ORDER BY description }; + my $sth = C4::Context->dbh->prepare($query); + $sth->execute; + my $suggestion_formats = $sth->fetchall_arrayref( {} ); + + foreach my $format (@$suggestion_formats) { + $dbh->do( + q| INSERT IGNORE INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) VALUES (?, ?, ?, ?, ?) |, {}, - 'SUGGEST_FORMAT', $format->{itemtype}, $format->{description}, $format->{description}, $format->{imageurl} + 'SUGGEST_FORMAT', $format->{itemtype}, $format->{description}, $format->{description}, + $format->{imageurl} ); } print "Upgrade to $DBversion done (Bug 9468: create new SUGGEST_FORMAT authorised_value list)\n"; -- 2.39.5