Bug 40262: (QA follow-up): Fix compatibility with ILLOpacUnauthenticatedRequest

This patch fixes the copyrightclearance_confirmed not saving if submitting an unauthenticated ILL request.

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-08-04 12:01:46 +00:00 committed by Lucas Gass
parent d572cdebcc
commit e8cc5a8d2f
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 13 additions and 12 deletions

View File

@ -620,6 +620,10 @@
<div class="page-section">
<h3>Request details</h3>
<h4>Details from library</h4>
[% copyrightclearance_confirmed = request.extended_attributes.find({'type'=>'copyrightclearance_confirmed'}).value %]
[% IF copyrightclearance_confirmed %]
<h5> <i class="fa fa-fw fa-check text-success" aria-hidden="true"></i> <span class="tab-title">Patron has confirmed copyright clearance for this request</span> </h5>
[% END %]
<div class="rows">
<ol>
[% IF request.orderid %]
@ -633,10 +637,6 @@
<span class="label borrowernumber">Patron:</span>
[% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %]
<a href="[% borrowerlink | url %]" title="View borrower details"> [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %] </a>
[% copyrightclearance_confirmed = request.extended_attributes.find({'type'=>'copyrightclearance_confirmed'}).value %]
[% IF copyrightclearance_confirmed %]
<i class="fa fa-fw fa-check text-success" aria-hidden="true"></i> <span class="tab-title">Patron has confirmed copyright clearance for this request</span>
[% END %]
</li>
[% END %]
[% IF request.biblio_id %]

View File

@ -200,6 +200,15 @@ if ( $op eq 'list' ) {
);
if ( $backend_result->{stage} eq 'commit' ) {
$request->extended_attributes(
[
{
type => 'copyrightclearance_confirmed',
value => 1,
}
]
) if $params->{copyrightclearance_confirmed};
# After creation actions
if ( $params->{type_disclaimer_submitted} ) {
$type_disclaimer->after_request_created( $params, $request );
@ -233,14 +242,6 @@ if ( $op eq 'list' ) {
$session->flush;
print $query->redirect('/cgi-bin/koha/opac-illrequests-unauthenticated.pl');
} else {
$request->extended_attributes(
[
{
type => 'copyrightclearance_confirmed',
value => 1,
}
]
) if $params->{copyrightclearance_confirmed};
print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2');
exit;
}