From dc49daf3d31734a037ebe5aeb96693f610ac8fdb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 10 Feb 2016 15:51:02 +0000 Subject: [PATCH] [SIGNED-OFF]Bug 15797: Remove C4::Koha::GetKohaImageurlFromAuthorisedValues This subroutine is no longer in used and can be remove. Test plan: git grep GetKohaImageurlFromAuthorisedValues should not return any results. Signed-off-by: Hector Castro Works as advertised --- C4/Koha.pm | 20 -------------------- t/db_dependent/Koha.t | 5 ++--- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 7171f16..a795651 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -65,7 +65,6 @@ BEGIN { &GetKohaAuthorisedValuesMapping &GetKohaAuthorisedValueLib &GetAuthorisedValueByCode - &GetKohaImageurlFromAuthorisedValues &GetAuthValCode &AddAuthorisedValue &GetNormalizedUPC @@ -1077,25 +1076,6 @@ sub displayServers { return \@primaryserverloop; } - -=head2 GetKohaImageurlFromAuthorisedValues - -$authhorised_value = GetKohaImageurlFromAuthorisedValues( $category, $authvalcode ); - -Return the first url of the authorised value image represented by $lib. - -=cut - -sub GetKohaImageurlFromAuthorisedValues { - my ( $category, $lib ) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?"); - $sth->execute( $category, $lib ); - while ( my $data = $sth->fetchrow_hashref ) { - return $data->{'imageurl'}; - } -} - =head2 GetAuthValCode $authvalcode = GetAuthValCode($kohafield,$frameworkcode); diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index c013434..048185a 100644 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -21,7 +21,7 @@ $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; subtest 'Authorized Values Tests' => sub { - plan tests => 8; + plan tests => 7; my $data = { category => 'CATEGORY', @@ -39,10 +39,9 @@ subtest 'Authorized Values Tests' => sub { # Tests SKIP: { - skip "INSERT failed", 5 unless $insert_success; + skip "INSERT failed", 4 unless $insert_success; is ( GetAuthorisedValueByCode($data->{category}, $data->{authorised_value}), $data->{lib}, "GetAuthorisedValueByCode" ); - is ( GetKohaImageurlFromAuthorisedValues($data->{category}, $data->{lib}), $data->{imageurl}, "GetKohaImageurlFromAuthorisedValues" ); my $sortdet=C4::Members::GetSortDetails("lost", "3"); is ($sortdet, "Lost and Paid For", "lost and paid works"); -- 1.7.10.4