diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm
index 36d4ea7940..47ae66f680 100644
--- a/Koha/ILL/Backend/Standard.pm
+++ b/Koha/ILL/Backend/Standard.pm
@@ -296,8 +296,10 @@ sub create {
C4::Context->preference("ILLOpacUnauthenticatedRequest") && !$other->{'cardnumber'};
if ($unauthenticated_request) {
( $failed, $result ) = _validate_form_params( $other, $result, $params );
- if ( !Koha::ILL::Request::unauth_request_data_check($other) ) {
- $result->{status} = "missing_unauth_data";
+ return $result if $failed;
+ my $unauth_request_error = Koha::ILL::Request::unauth_request_data_error($other);
+ if ($unauth_request_error) {
+ $result->{status} = $unauth_request_error;
$result->{value} = $params;
$failed = 1;
}
diff --git a/Koha/ILL/Backend/opac-includes/create.inc b/Koha/ILL/Backend/opac-includes/create.inc
index fa2bad0423..b4d5e2c2e5 100644
--- a/Koha/ILL/Backend/opac-includes/create.inc
+++ b/Koha/ILL/Backend/opac-includes/create.inc
@@ -27,6 +27,8 @@
Please note: The library you chose is invalid.
+[% ELSIF whole.status == 'failed_captcha' %]
+ You typed in the wrong characters in the box before submitting. Please try again.
[% ELSE %]
Unhandled error
[% END %]
@@ -119,6 +121,22 @@
[% INCLUDE "${cwd}/shared-includes/forms/${type}.inc" %]
[% END %]
[% INCLUDE "${cwd}/shared-includes/custom_fields.inc" %]
+ [% IF whole.value.other.type && unauthenticated_ill && !logged_in_user%]
+
+ [% END %]