Bugzilla – Attachment 153161 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 GetSuggestionInfoFromBiblionumber
Bug-28844-Remove-GetSuggestionInfoFromBiblionumber.patch (text/plain), 4.78 KB, created by
Jonathan Druart
on 2023-07-07 11:37:23 UTC
(
hide
)
Description:
Bug 28844: Remove GetSuggestionInfoFromBiblionumber
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-07-07 11:37:23 UTC
Size:
4.78 KB
patch
obsolete
>From de2a3c0fda021fe5409d2b45b9685d7f7fcec1f0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 May 2023 15:19:38 +0200 >Subject: [PATCH] Bug 28844: Remove GetSuggestionInfoFromBiblionumber > >--- > C4/Suggestions.pm | 28 ---------------------------- > t/db_dependent/Suggestions.t | 19 ++----------------- > 2 files changed, 2 insertions(+), 45 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 14c6b203c1b..29c092426cc 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -36,7 +36,6 @@ our @EXPORT = qw( > GetSuggestion > GetSuggestionByStatus > GetSuggestionFromBiblionumber >- GetSuggestionInfoFromBiblionumber > GetSuggestionInfo > ModStatus > ModSuggestion >@@ -119,33 +118,6 @@ sub GetSuggestionFromBiblionumber { > return $suggestionid; > } > >-=head2 GetSuggestionInfoFromBiblionumber >- >-Get a suggestion and borrower's informations from it's biblionumber. >- >-return : >-all informations (suggestion and borrower) of the suggestion which is related to the biblionumber given. >- >-=cut >- >-sub GetSuggestionInfoFromBiblionumber { >- my ($biblionumber) = @_; >- my $query = q{ >- SELECT suggestions.*, >- U1.surname AS surnamesuggestedby, >- U1.firstname AS firstnamesuggestedby, >- U1.borrowernumber AS borrnumsuggestedby >- FROM suggestions >- LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber >- WHERE biblionumber=? >- LIMIT 1 >- }; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare($query); >- $sth->execute($biblionumber); >- return $sth->fetchrow_hashref; >-} >- > =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 b5d4b5390f5..65864756293 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 => 91; >+use Test::More tests => 79; > 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 GetSuggestionInfoFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); >+ use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); > } > > my $schema = Koha::Database->new->schema; >@@ -292,21 +292,6 @@ is( GetSuggestionFromBiblionumber(2), undef, 'GetSuggestionFromBiblionumber with > is( GetSuggestionFromBiblionumber($biblio_1->biblionumber), $my_suggestionid, 'GetSuggestionFromBiblionumber functions correctly' ); > > >-is( GetSuggestionInfoFromBiblionumber(), undef, 'GetSuggestionInfoFromBiblionumber without the biblio number returns undef' ); >-is( GetSuggestionInfoFromBiblionumber(2), undef, 'GetSuggestionInfoFromBiblionumber with an invalid biblio number returns undef' ); >-$suggestion = GetSuggestionInfoFromBiblionumber($biblio_1->biblionumber); >-is( $suggestion->{suggestionid}, $my_suggestionid, 'GetSuggestionInfoFromBiblionumber returns the suggestion id correctly' ); >-is( $suggestion->{title}, $mod_suggestion1->{title}, 'GetSuggestionInfoFromBiblionumber returns the title correctly' ); >-is( $suggestion->{author}, $mod_suggestion1->{author}, 'GetSuggestionInfoFromBiblionumber returns the author correctly' ); >-is( $suggestion->{publishercode}, $mod_suggestion1->{publishercode}, 'GetSuggestionInfoFromBiblionumber returns the publisher code correctly' ); >-is( $suggestion->{suggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfoFromBiblionumber returns the borrower number correctly' ); >-is( $suggestion->{biblionumber}, $my_suggestion->{biblionumber}, 'GetSuggestionInfoFromBiblionumber returns the biblio number correctly' ); >-is( $suggestion->{STATUS}, $mod_suggestion3->{STATUS}, 'GetSuggestionInfoFromBiblionumber returns the status correctly' ); >-is( $suggestion->{surnamesuggestedby}, $member->{surname}, 'GetSuggestionInfoFromBiblionumber returns the surname correctly' ); >-is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInfoFromBiblionumber returns the firstname correctly' ); >-is( $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfoFromBiblionumeber returns the borrower number 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