From b09bc3c9485dfdad03d716ee5ced6f241ae4d330 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 17 Sep 2026 09:32:30 -0400 Subject: [PATCH] Bug 43519: Direct links to article request form still work when the feature is disabled This patch adds a check for the ArticleRequests system preference in opac-request-article.pl so that the page will return a 404 error if the preference is disabled. To test, apply the patch and restart services. - If necessary, enable the ArticleRequests system preference and configure a circulation rule to allow article requests. - Locate a bibliographic record in the OPAC which will accept an article request. Note the biblionumber of the record you select. - Click "Request article" and complete the process. It should finish successfully. - Disable the ArticleRequests system preference. - Return to the OPAC and navigate directly to the page for requesting an article: http://localhost:8080/cgi-bin/koha/opac-request-article.pl?biblionumber=X ...where X is the biblionumber you noted before. - This should trigger a 404 error. Sponsored-by: Athens County Public Libraries Signed-off-by: Bastien CHAUVET Signed-off-by: Laura_Escamilla Signed-off-by: Pedro Amorim --- opac/opac-request-article.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl index a20f068c50..25782d6a1a 100755 --- a/opac/opac-request-article.pl +++ b/opac/opac-request-article.pl @@ -33,6 +33,12 @@ use Try::Tiny; my $cgi = CGI->new; +# if ArticleRequests is disabled, leave immediately +if ( !C4::Context->preference('ArticleRequests') ) { + print $cgi->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} + my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => "opac-request-article.tt",