Bug 28146: Respect ReplytoDefault in error pages

Test plan:
Fill ReplytoDefault.
Check an error page on OPAC and intranet.
Verify that the send mail link refers to that email address.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2025-10-06 14:20:05 +02:00 committed by Lucas Gass
parent c53fdd3623
commit 0562121424
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
14 changed files with 3 additions and 24 deletions

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => 'errors/errorpage.tt', template_name => 'errors/errorpage.tt',
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 400, errno => 400,
); );
my $status = '400 Bad Request'; my $status = '400 Bad Request';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => 'errors/errorpage.tt', template_name => 'errors/errorpage.tt',
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 401, errno => 401,
); );
my $status = '401 Unauthorized'; my $status = '401 Unauthorized';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => 'errors/errorpage.tt', template_name => 'errors/errorpage.tt',
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 402, errno => 402,
); );
my $status = '402 Payment Required'; my $status = '402 Payment Required';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => 'errors/errorpage.tt', template_name => 'errors/errorpage.tt',
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 403, errno => 403,
csrf_error => $ENV{'plack.middleware.Koha.CSRF'}, csrf_error => $ENV{'plack.middleware.Koha.CSRF'},
); );

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => 'errors/errorpage.tt', template_name => 'errors/errorpage.tt',
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 404, errno => 404,
); );
my $status = '404 Not Found'; my $status = '404 Not Found';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => 'errors/errorpage.tt', template_name => 'errors/errorpage.tt',
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 500, errno => 500,
); );
my $status = '500 Internal Server Error'; my $status = '500 Internal Server Error';

View File

@ -1,5 +1,6 @@
[% USE raw %] [% USE raw %]
[% USE Koha %] [% USE Koha %]
[% SET admin = Koha.Preference('ReplytoDefault') || Koha.Preference('KohaAdminEmailAddress') %]
[% PROCESS 'i18n.inc' %] [% PROCESS 'i18n.inc' %]
[% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'doc-head-open.inc' %]
<title <title

View File

@ -1,9 +1,11 @@
[% USE raw %] [% USE raw %]
[% USE AdditionalContents %] [% USE AdditionalContents %]
[% USE Koha %]
[% PROCESS 'i18n.inc' %] [% PROCESS 'i18n.inc' %]
[% PROCESS 'html_helpers.inc' %] [% PROCESS 'html_helpers.inc' %]
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
[% SET admin = Koha.Preference('ReplytoDefault') || Koha.Preference('KohaAdminEmailAddress') %]
[% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'doc-head-open.inc' %]
<title <title
>[% FILTER collapse %] >[% FILTER collapse %]

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "errors/errorpage.tt", template_name => "errors/errorpage.tt",
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 400, errno => 400,
); );
my $status = '400 Bad Request'; my $status = '400 Bad Request';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "errors/errorpage.tt", template_name => "errors/errorpage.tt",
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 401, errno => 401,
); );
my $status = '401 Unauthorized'; my $status = '401 Unauthorized';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "errors/errorpage.tt", template_name => "errors/errorpage.tt",
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 402, errno => 402,
); );
my $status = '402 Payment Required'; my $status = '402 Payment Required';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "errors/errorpage.tt", template_name => "errors/errorpage.tt",
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 403, errno => 403,
csrf_error => $ENV{'plack.middleware.Koha.CSRF'}, csrf_error => $ENV{'plack.middleware.Koha.CSRF'},
); );

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "errors/errorpage.tt", template_name => "errors/errorpage.tt",
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 404, errno => 404,
); );
my $status = '404 Not Found'; my $status = '404 Not Found';

View File

@ -23,7 +23,6 @@ use C4::Context;
use List::MoreUtils qw( any ); use List::MoreUtils qw( any );
my $query = CGI->new; my $query = CGI->new;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "errors/errorpage.tt", template_name => "errors/errorpage.tt",
@ -33,7 +32,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
} }
); );
$template->param( $template->param(
admin => $admin,
errno => 500, errno => 500,
); );
my $status = '500 Internal Server Error'; my $status = '500 Internal Server Error';