From f5bf73f72262844a840f6d11c96cfde08a8471a8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 16 Jul 2021 09:46:59 +0200 Subject: [PATCH] Bug 17600: Fix tests No idea why UpdateStats in C4::Circulation needs the fully qualified namespace! I kept getting Undefined subroutine &C4::Circulation::UpdateStats called at /kohadevbox/koha/C4/Circulation.pm line 1643. Signed-off-by: Jonathan Druart --- C4/Circulation.pm | 8 ++++---- C4/Stats.pm | 7 +++---- acqui/addorderiso2709.pl | 4 ++-- acqui/edimsg.pl | 2 +- acqui/parcel.pl | 2 +- misc/translator/VerboseWarnings.pm | 12 ++++++------ misc/translator/tmpl_process3.pl | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0549230964..10e17c045d 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -790,7 +790,7 @@ sub CanBookBeIssued { # if ( $patron->category->category_type eq 'X' && ( $item_object->barcode )) { # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . - &UpdateStats({ + C4::Stats::UpdateStats({ branch => C4::Context->userenv->{'branch'}, type => 'localuse', itemnumber => $item_object->itemnumber, @@ -1631,7 +1631,7 @@ sub AddIssue { } # Record the fact that this book was issued. - &UpdateStats( + C4::Stats::UpdateStats( { branch => C4::Context->userenv->{'branch'}, type => ( $onsite_checkout ? 'onsite_checkout' : 'issue' ), @@ -2229,7 +2229,7 @@ sub AddReturn { } # Record the fact that this book was returned. - UpdateStats({ + C4::Stats::UpdateStats({ branch => $branch, type => $stat_type, itemnumber => $itemnumber, @@ -3117,7 +3117,7 @@ sub AddRenewal { } # Add the renewal to stats - UpdateStats( + C4::Stats::UpdateStats( { branch => $item_object->renewal_branchcode({branch => $branch}), type => 'renew', diff --git a/C4/Stats.pm b/C4/Stats.pm index 7d63f18aa9..1b883d2de1 100644 --- a/C4/Stats.pm +++ b/C4/Stats.pm @@ -19,7 +19,6 @@ package C4::Stats; # along with Koha; if not, see . use Modern::Perl; -require Exporter; use Carp qw( croak ); use C4::Context; @@ -27,11 +26,11 @@ use Koha::DateUtils qw( dt_from_string ); use Koha::Statistics; use Koha::PseudonymizedTransactions; -use vars qw(@ISA @EXPORT); - +our (@ISA, @EXPORT_OK); BEGIN { + require Exporter; @ISA = qw(Exporter); - @EXPORT = qw( + @EXPORT_OK = qw( UpdateStats ); } diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 43abac8207..404c3334bd 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -30,7 +30,7 @@ use Encode; use C4::Context; use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); -use C4::ImportBatch qw( GetImportRecordsRange GetImportRecordMarc GetImportRecordMatches sub SetImportRecordStatus SetMatchedBiblionumber SetImportBatchStatus GetImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction ); +use C4::ImportBatch qw( GetImportRecordsRange GetImportRecordMarc GetImportRecordMatches SetImportRecordStatus SetMatchedBiblionumber SetImportBatchStatus GetImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction ); use C4::Matcher; use C4::Search qw( FindDuplicate ); use C4::Acquisition qw( populate_order_with_prices ); @@ -41,7 +41,7 @@ use C4::Biblio qw( GetMarcQuantity TransformHtmlToXml ); -use C4::Items qw( PrepareItemrecordDisplay sub AddItemFromMarc ); +use C4::Items qw( PrepareItemrecordDisplay AddItemFromMarc ); use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget GetBudgetByCode ); use C4::Acquisition qw( populate_order_with_prices ); use C4::Suggestions; # GetSuggestion diff --git a/acqui/edimsg.pl b/acqui/edimsg.pl index 8ac9b8039e..05340d4481 100755 --- a/acqui/edimsg.pl +++ b/acqui/edimsg.pl @@ -19,7 +19,7 @@ use Modern::Perl; use CGI; -use Koha::Databas; +use Koha::Database; use C4::Koha; use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); diff --git a/acqui/parcel.pl b/acqui/parcel.pl index d00d9bdb1e..06172690f6 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -58,7 +58,7 @@ use Modern::Perl; use C4::Auth qw( get_template_and_user ); use C4::Acquisition qw( CancelReceipt GetInvoice GetInvoiceDetails get_rounded_price ); -use C4::Budgets qw( _round GetBudget GetBudgetByOrderNumber GetBudgetName ); +use C4::Budgets qw( GetBudget GetBudgetByOrderNumber GetBudgetName ); use CGI qw ( -utf8 ); use C4::Output qw( output_html_with_http_headers ); use C4::Suggestions qw( GetSuggestion GetSuggestionInfoFromBiblionumber GetSuggestionInfo ); diff --git a/misc/translator/VerboseWarnings.pm b/misc/translator/VerboseWarnings.pm index 5225f74cc9..e2ee42377b 100644 --- a/misc/translator/VerboseWarnings.pm +++ b/misc/translator/VerboseWarnings.pm @@ -22,12 +22,12 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( - &pedantic_p - &warn_additional - &warn_normal - &warn_pedantic - &error_additional - &error_normal + pedantic_p + warn_additional + warn_normal + warn_pedantic + error_additional + error_normal ); } diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl index 2a9643d282..8d270829f6 100755 --- a/misc/translator/tmpl_process3.pl +++ b/misc/translator/tmpl_process3.pl @@ -20,7 +20,7 @@ use File::Basename qw( fileparse ); use Getopt::Long qw( GetOptions ); use Locale::PO; use TmplTokenizer; -use VerboseWarnings qw( :warn :die ); +use VerboseWarnings qw( pedantic_p warn_additional warn_normal warn_pedantic error_additional error_normal ); ############################################################################### -- 2.39.5