Bugzilla – Attachment 153176 Details for
Bug 28844
Suggestion from existing title can alert patron in error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28844: Remove GetSuggestionFromBiblionumber
Bug-28844-Remove-GetSuggestionFromBiblionumber.patch (text/plain), 3.21 KB, created by
Jonathan Druart
on 2023-07-07 12:43:23 UTC
(
hide
)
Description:
Bug 28844: Remove GetSuggestionFromBiblionumber
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-07-07 12:43:23 UTC
Size:
3.21 KB
patch
obsolete
>From 345f1bb4942b26fc0722643811805356133ceacf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 May 2023 15:21:35 +0200 >Subject: [PATCH] Bug 28844: Remove GetSuggestionFromBiblionumber > >--- > C4/Suggestions.pm | 26 -------------------------- > t/db_dependent/Suggestions.t | 9 ++------- > 2 files changed, 2 insertions(+), 33 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 29c092426cc..f76cca60b88 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -35,7 +35,6 @@ our @EXPORT = qw( > DelSuggestion > GetSuggestion > GetSuggestionByStatus >- GetSuggestionFromBiblionumber > GetSuggestionInfo > ModStatus > ModSuggestion >@@ -93,31 +92,6 @@ sub GetSuggestion { > return ( $sth->fetchrow_hashref ); > } > >-=head2 GetSuggestionFromBiblionumber >- >-$ordernumber = &GetSuggestionFromBiblionumber($biblionumber) >- >-Get a suggestion from it's biblionumber. >- >-return : >-the id of the suggestion which is related to the biblionumber given on input args. >- >-=cut >- >-sub GetSuggestionFromBiblionumber { >- my ($biblionumber) = @_; >- my $query = q{ >- SELECT suggestionid >- FROM suggestions >- WHERE biblionumber=? LIMIT 1 >- }; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare($query); >- $sth->execute($biblionumber); >- my ($suggestionid) = $sth->fetchrow; >- return $suggestionid; >-} >- > =head2 GetSuggestionInfo > > Get a suggestion and borrower's informations from it's suggestionid >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 65864756293..4bafd2d261c 100755 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use DateTime::Duration; >-use Test::More tests => 79; >+use Test::More tests => 76; > use Test::Warn; > > use t::lib::Mocks; >@@ -34,7 +34,7 @@ use Koha::Patrons; > use Koha::Suggestions; > > BEGIN { >- use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); >+ use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); > } > > my $schema = Koha::Database->new->schema; >@@ -287,11 +287,6 @@ is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInf > is( $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfo returns the borrower number correctly' ); > > >-is( GetSuggestionFromBiblionumber(), undef, 'GetSuggestionFromBiblionumber without the biblio number returns undef' ); >-is( GetSuggestionFromBiblionumber(2), undef, 'GetSuggestionFromBiblionumber with an invalid biblio number returns undef' ); >-is( GetSuggestionFromBiblionumber($biblio_1->biblionumber), $my_suggestionid, 'GetSuggestionFromBiblionumber functions correctly' ); >- >- > my $suggestions = GetSuggestionByStatus(); > is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); > $suggestions = GetSuggestionByStatus('CHECKED'); >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28844
:
151001
|
151002
|
151003
|
151004
|
151005
|
151006
|
151007
|
153157
|
153158
|
153159
|
153160
|
153161
|
153162
|
153163
|
153174
|
153175
|
153176
|
158982
|
158983
|
158984
|
158985
|
158986
|
158987
|
158988
|
158989
|
158990
|
159759
|
159760
|
159761
|
159762
|
159763
|
159764
|
159765
|
159766
|
159767
|
159768