Bugzilla – Attachment 176343 Details for
Bug 22415
Koha::EDI should not use Log::Log4perl directly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22415: (QA follow-up) Fix misc qa issues
Bug-22415-QA-follow-up-Fix-misc-qa-issues.patch (text/plain), 4.25 KB, created by
Kyle M Hall (khall)
on 2025-01-10 14:42:43 UTC
(
hide
)
Description:
Bug 22415: (QA follow-up) Fix misc qa issues
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-01-10 14:42:43 UTC
Size:
4.25 KB
patch
obsolete
>From 0d4abe79e2c03ae871b3d43bd6ed3777ad7de0d2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 10 Jan 2025 14:38:03 +0000 >Subject: [PATCH] Bug 22415: (QA follow-up) Fix misc qa issues > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/EDI.pm | 12 ++++++------ > misc/cronjobs/edi_cron.pl | 8 ++++---- > 2 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index 70a4b69dfc7..8e033f7c4f0 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -173,7 +173,7 @@ sub process_ordrsp { > $response_message->status('processing'); > $response_message->update; > my $schema = Koha::Database->new()->schema(); >- my $logger = Koha::Logger->get({ interface => 'edi' }); >+ my $logger = Koha::Logger->get( { interface => 'edi' } ); > my $vendor_acct; > my $edi = > Koha::Edifact->new( { transmission => $response_message->raw_msg, } ); >@@ -227,7 +227,7 @@ sub process_invoice { > $invoice_message->status('processing'); > $invoice_message->update; > my $schema = Koha::Database->new()->schema(); >- my $logger = Koha::Logger->get({ interface => 'edi' }); >+ my $logger = Koha::Logger->get( { interface => 'edi' } ); > my $vendor_acct; > > my $plugin_class = $invoice_message->edi_acct()->plugin(); >@@ -442,7 +442,7 @@ sub _get_invoiced_price { > > sub receipt_items { > my ( $schema, $inv_line, $ordernumber, $quantity ) = @_; >- my $logger = Koha::Logger->get({ interface => 'edi' }); >+ my $logger = Koha::Logger->get( { interface => 'edi' } ); > > # itemnumber is not a foreign key ??? makes this a bit cumbersome > my @item_links = $schema->resultset('AqordersItem')->search( >@@ -542,7 +542,7 @@ sub transfer_items { > } > ++$gocc; > } >- my $logger = Koha::Logger->get({ interface => 'edi' }); >+ my $logger = Koha::Logger->get( { interface => 'edi' } ); > my $o1 = $order_from->ordernumber; > my $o2 = $order_to->ordernumber; > $logger->warn("transferring $quantity copies from order $o1 to order $o2"); >@@ -586,7 +586,7 @@ sub process_quote { > > my $messages = $edi->message_array(); > my $process_errors = 0; >- my $logger = Koha::Logger->get({ interface => 'edi' }); >+ my $logger = Koha::Logger->get( { interface => 'edi' } ); > my $schema = Koha::Database->new()->schema(); > my $message_count = 0; > my @added_baskets; # if auto & multiple baskets need to order all >@@ -671,7 +671,7 @@ sub quote_item { > my ( $item, $quote, $basketno ) = @_; > > my $schema = Koha::Database->new()->schema(); >- my $logger = Koha::Logger->get({ interface => 'edi' }); >+ my $logger = Koha::Logger->get( { interface => 'edi' } ); > > # $basketno is the return from AddBasket in the calling routine > # So this call should not fail unless that has >diff --git a/misc/cronjobs/edi_cron.pl b/misc/cronjobs/edi_cron.pl >index 1541b5dbde9..51cad77d6a0 100755 >--- a/misc/cronjobs/edi_cron.pl >+++ b/misc/cronjobs/edi_cron.pl >@@ -41,6 +41,7 @@ use Fcntl qw( LOCK_EX O_CREAT O_RDWR SEEK_SET ); > die "Syspref 'EDIFACT' is disabled" unless C4::Context->preference('EDIFACT'); > > # we dont have a lock dir in context so use the logdir >+my $logdir = C4::Context->config('logdir'); > my $pidfile = "$logdir/edicron.pid"; > > my $pid_handle = check_pidfile(); >@@ -49,7 +50,7 @@ my $schema = Koha::Database->new()->schema(); > > my @edi_accts = $schema->resultset('VendorEdiAccount')->all(); > >-my $logger = Koha::Logger->get({ interface => 'edi', prefix => 0 }); >+my $logger = Koha::Logger->get( { interface => 'edi', prefix => 0 } ); > > for my $acct (@edi_accts) { > if ( $acct->quotes_enabled ) { >@@ -144,8 +145,7 @@ foreach my $response (@downloaded_responses) { > if ( close $pid_handle ) { > unlink $pidfile; > exit 0; >-} >-else { >+} else { > $logger->error("Error on pidfile close: $!"); > exit 1; > } >@@ -154,7 +154,7 @@ sub check_pidfile { > > # sysopen my $fh, $pidfile, O_EXCL | O_RDWR or log_exit "$0 already running" > sysopen my $fh, $pidfile, O_RDWR | O_CREAT >- or log_exit("$0: open $pidfile: $!"); >+ or log_exit("$0: open $pidfile: $!"); > flock $fh => LOCK_EX or log_exit("$0: flock $pidfile: $!"); > > sysseek $fh, 0, SEEK_SET or log_exit("$0: sysseek $pidfile: $!"); >-- >2.39.2
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 22415
:
175402
|
175403
|
175483
|
175484
|
176341
|
176342
| 176343