Bugzilla – Attachment 193493 Details for
Bug 39724
Remove GetSuggestionInfo from C4/Suggestions.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39724: Remove GetSuggestionInfo from C4/Suggestions.pm
Bug-39724-Remove-GetSuggestionInfo-from-C4Suggesti.patch (text/plain), 8.25 KB, created by
Owen Leonard
on 2026-02-19 17:26:16 UTC
(
hide
)
Description:
Bug 39724: Remove GetSuggestionInfo from C4/Suggestions.pm
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-02-19 17:26:16 UTC
Size:
8.25 KB
patch
obsolete
>From 6ae5ce15ec89b51f57fd759b8913420b9da1f63e Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Thu, 19 Feb 2026 14:34:21 +0000 >Subject: [PATCH] Bug 39724: Remove GetSuggestionInfo from C4/Suggestions.pm > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Suggestions.pm | 28 ---------------------------- > acqui/basket.pl | 5 ++--- > acqui/neworderempty.pl | 9 ++++----- > acqui/orderreceive.pl | 9 +-------- > acqui/parcel.pl | 1 - > t/db_dependent/Suggestions.t | 29 ++--------------------------- > 6 files changed, 9 insertions(+), 72 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index d1ed57fda99..1ce0a5364d4 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -27,7 +27,6 @@ BEGIN { > DelSuggestion > GetSuggestion > GetSuggestionByStatus >- GetSuggestionInfo > ModStatus > ModSuggestion > DelSuggestionsOlderThan >@@ -71,33 +70,6 @@ Suggestions done by other borrowers can be seen when not "AVAILABLE" > > =head1 FUNCTIONS > >-=head2 GetSuggestionInfo >- >-Get a suggestion and borrower's information from it's suggestionid >- >-return : >-all information (suggestion and borrower) of the suggestion which is related to the suggestionid given. >- >-=cut >- >-sub GetSuggestionInfo { >- my ($suggestionid) = @_; >- 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 suggestionid=? >- LIMIT 1 >- }; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare($query); >- $sth->execute($suggestionid); >- return $sth->fetchrow_hashref; >-} >- > =head2 GetSuggestionByStatus > > $aqorders = &GetSuggestionByStatus($status,[$branchcode]) >diff --git a/acqui/basket.pl b/acqui/basket.pl >index bcddc385228..a570e802333 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -26,9 +26,8 @@ use C4::Output qw( output_html_with_http_headers output_and_exit ); > use CGI qw ( -utf8 ); > use C4::Acquisition > qw( GetBasket CanUserManageBasket GetBasketAsCSV NewBasket NewBasketgroup ModBasket ReopenBasket ModBasketUsers GetBasketgroup GetBasketgroups GetBasketUsers GetOrders GetOrder get_rounded_price ); >-use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); >-use C4::Contract qw( GetContract ); >-use C4::Suggestions qw( GetSuggestionInfo ); >+use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); >+use C4::Contract qw( GetContract ); > use Koha::Biblios; > use Koha::Acquisition::Baskets; > use Koha::Acquisition::Booksellers; >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 307c48509e2..1f0c87c5b25 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -72,7 +72,6 @@ use C4::Budgets qw( GetBudget GetBudgetHierarchy CanUserUseBudget ); > > use C4::Acquisition qw( GetOrder GetBasket FillWithDefaultValues GetOrderUsers ); > use C4::Contract qw( GetContract ); >-use C4::Suggestions qw( GetSuggestionInfo ); > use C4::Biblio qw( > AddBiblio > GetBiblioData >@@ -323,7 +322,7 @@ if ( not $ordernumber or $biblionumber ) { > $template->param( catalog_details => \@catalog_details, ); > > my $suggestion; >-$suggestion = GetSuggestionInfo($suggestionid) if $suggestionid; >+$suggestion = Koha::Suggestions->find( { suggestionid => $suggestionid } ) if $suggestionid; > > my $active_currency = Koha::Acquisition::Currencies->get_active; > >@@ -461,9 +460,9 @@ $template->param( > closedate => $basket->{'closedate'}, > > # order details >- suggestionid => $suggestion->{suggestionid}, >- surnamesuggestedby => $suggestion->{surnamesuggestedby}, >- firstnamesuggestedby => $suggestion->{firstnamesuggestedby}, >+ suggestionid => $suggestion->suggestionid, >+ surnamesuggestedby => $suggestion->surname, >+ firstnamesuggestedby => $suggestion->firstname, > biblionumber => $biblionumber, > uncertainprice => $data->{'uncertainprice'}, > discount_2dp => sprintf( "%.2f", $bookseller->discount ), # for display >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index c5b510fcbe5..0b00ab64934 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -66,8 +66,7 @@ use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > use C4::Budgets qw( GetBudget GetBudgetPeriods GetBudgetPeriod GetBudgetHierarchy CanUserUseBudget ); > use C4::Members; >-use C4::Biblio qw( GetMarcStructure ); >-use C4::Suggestions qw( GetSuggestionInfo ); >+use C4::Biblio qw( GetMarcStructure ); > > use Koha::Acquisition::Booksellers; > use Koha::Acquisition::Currencies; >@@ -133,12 +132,6 @@ if ($order) { > $template->param( orders => $orders, ); > } > >- my $suggestion = GetSuggestionInfoFromBiblionumber( $order->biblionumber ); >- >- if ($suggestion) { >- $template->param( suggestion => $suggestion ); >- } >- > $template->param( > order => $order, > creator => $creator, >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 3ed89728066..8828d7086f7 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -60,7 +60,6 @@ use C4::Acquisition qw( CancelReceipt GetInvoice GetInvoiceDetails get_rounded_p > use C4::Budgets qw( GetBudget GetBudgetByOrderNumber GetBudgetName ); > use CGI qw ( -utf8 ); > use C4::Output qw( output_html_with_http_headers ); >-use C4::Suggestions qw( GetSuggestionInfo ); > > use Koha::Acquisition::Baskets; > use Koha::Acquisition::Bookseller; >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 98824879510..6cf914b3318 100755 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use DateTime::Duration; > use Test::NoWarnings; >-use Test::More tests => 80; >+use Test::More tests => 69; > use Test::Warn; > > use t::lib::Mocks; >@@ -38,7 +38,7 @@ use Koha::Suggestions; > BEGIN { > use_ok( > 'C4::Suggestions', >- qw( ModSuggestion GetSuggestionInfo GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan ) >+ qw( ModSuggestion GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan ) > ); > } > >@@ -310,31 +310,6 @@ $messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber2 > > is( scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error' ); > >-is( GetSuggestionInfo(), undef, 'GetSuggestionInfo without the suggestion id returns undef' ); >-$suggestion = GetSuggestionInfo($my_suggestionid); >-is( $suggestion->{suggestionid}, $my_suggestionid, 'GetSuggestionInfo returns the suggestion id correctly' ); >-is( $suggestion->{title}, $mod_suggestion1->{title}, 'GetSuggestionInfo returns the title correctly' ); >-is( $suggestion->{author}, $mod_suggestion1->{author}, 'GetSuggestionInfo returns the author correctly' ); >-is( >- $suggestion->{publishercode}, $mod_suggestion1->{publishercode}, >- 'GetSuggestionInfo returns the publisher code correctly' >-); >-is( >- $suggestion->{suggestedby}, $my_suggestion->{suggestedby}, >- 'GetSuggestionInfo returns the borrower number correctly' >-); >-is( >- $suggestion->{biblionumber}, $my_suggestion->{biblionumber}, >- 'GetSuggestionInfo returns the biblio number correctly' >-); >-is( $suggestion->{STATUS}, $mod_suggestion3->{STATUS}, 'GetSuggestionInfo returns the status correctly' ); >-is( $suggestion->{surnamesuggestedby}, $member->{surname}, 'GetSuggestionInfo returns the surname correctly' ); >-is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInfo returns the firstname correctly' ); >-is( >- $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, >- 'GetSuggestionInfo returns the borrower number correctly' >-); >- > my $suggestions = GetSuggestionByStatus(); > is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); > $suggestions = GetSuggestionByStatus('CHECKED'); >-- >2.39.5
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 39724
:
181405
|
193480
|
193483
|
193484
| 193493