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 <bastien.chauvet@inlibro.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
04314c4fbc
commit
b09bc3c948
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue