Bug 41204: Fallback to Standard earlier

The fallback to 'Standard' if 'FreeForm' needs to happen earlier in the code, before other backend checks are performed

Test plan, before applying patch:
1) Enabled ILLModule
2) Login to OPAC and access a FreeForm URL directly:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?backend=FreeForm&op=add_form
3) Notice you get a 404. Apply patch and restart plack.
4) Repeat 2) Notice you get the 'Standard' form as expected. Create the ILL request. It's created as a 'Standard' request.

Signed-off-by: Leo O’Neill <leo.o’neill@uwl.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-11-06 11:14:07 +00:00 committed by Lucas Gass
parent 8ba4d26dab
commit afaee3651b
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 1 additions and 1 deletions

View File

@ -74,6 +74,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
# Are we able to actually work?
my $patron = Koha::Patrons->find($loggedinuser);
my $backends = Koha::ILL::Request::Config->new->opac_available_backends($patron);
$params->{backend} = 'Standard' if $params->{backend} eq 'FreeForm';
if ( $params->{backend} && !grep { $_ eq $params->{backend} } @$backends ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");
@ -131,7 +132,6 @@ if ( $op eq 'list' ) {
);
}
$params->{backend} = 'Standard' if $params->{backend} eq 'FreeForm';
my $request = Koha::ILL::Request->new->load_backend( $params->{backend} );
# Before request creation operations - Preparation