Bug 40866: Remove original Bug 9762 implementation remnants (Part 3 - Returns)

This patch removes the duplicate logging code from circ/returns.pl that
was part of the original Bug 9762 implementation.

The original implementation added a separate logaction() call when
ignoring holds on return. This code created a custom JSON log entry
with the message "return an element that is reserved".

However, this logging appears to have been orphaned - there is no
corresponding Alternative implementation for return override logging
in the current codebase. The code was creating log entries but they
were not properly integrated with any override confirmation workflow.

Changes:

circ/returns.pl:
- Removed entire else block that created custom override log entries
- Removed unused variables: $message, @message, $user, $branchcode, $barcode
- Removed C4::Log qw(logaction) import as it's no longer needed

This eliminates the orphaned logging code and ensures returns.pl only
uses standard Koha logging mechanisms.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2025-10-09 07:31:43 +01:00 committed by Lucas Gass
parent ca47310a3b
commit 9ce4533b75
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 0 additions and 27 deletions

View File

@ -42,7 +42,6 @@ use C4::Members;
use C4::Output qw( output_html_with_http_headers );
use C4::Reserves qw( ModReserve ModReserveAffect CheckReserves );
use C4::RotatingCollections;
use C4::Log qw( logaction );
use Koha::AuthorisedValues;
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
use Koha::BiblioFrameworks;
@ -160,32 +159,6 @@ if ( $query->param('reserve_id') && $op eq 'cud-affect_reserve' ) {
$transfer->transit;
}
}
} else {
my $message = "return an element that is reserved";
my @message = ("return an element that is reserved");
my $user = C4::Context->userenv->{number};
my $branchcode = C4::Context->userenv->{branch};
my $barcode = $query->param('barcode');
my $infos = (
{
message => \@message,
#'card number' => $cardnumber,
barcode => $barcode,
manager_id => $user,
branchcode => $branchcode,
}
);
my $json_infos = JSON->new->utf8->pretty->encode($infos);
$json_infos =~ s/"/'/g;
logaction(
"CIRCULATION", "RETURN",
$session,
$json_infos,
) if C4::Context->preference("ReturnLog");
}
if ( $query->param('recall_id') && $op eq 'cud-affect_recall' ) {