Koha/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc
Jonathan Druart 62285d2de4 Bug 20351: Shortcut serials scripts if a blocking error appeared
The idea of output_and_exit_if_error (added by bug 18403) is to make sure
parameters are valid before executing the script.
If not (old or broken URLs), we shortcut everything coming next to display a
generic error ("object does not exist", "you do not have permission to do that", etc.)

This bug report fixes the scripts under serials/*.

Test plan:
Hit the script under the serials directory with an invalid subscriptionid parameter
and confirm you get an error instead of the normal view with empty values.

The goal is not to be exhaustive during the first iteration, but at least to fix
the most common views.

For instance:
/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=XXX
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=XXX
/cgi-bin/koha/serials/routing.pl?subscriptionid=XXX&op=new
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=XXx
/cgi-bin/koha/serials/subscription-add.pl?op=dup&subscriptionid=XXX

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-10-17 14:25:30 +00:00

17 lines
861 B
HTML

[% IF blocking_error %]
[% SWITCH blocking_error %]
[% CASE 'unknown_patron' %]
<div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
[% CASE 'cannot_see_patron_infos' %]You are not allowed to see the information of this patron.
[% CASE 'unknown_biblio' %]
<div class="dialog message">This bibliographic record does not exist.</div>
[% CASE 'unknown_item' %]
<div class="dialog message">This item does not exist.</div>
[% CASE 'unknown_subscription' %]
<div class="dialog message">This subscription does not exist.</div>
[% CASE %][% blocking_error | html %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% STOP %] [%# Will stop gracefully without processing any more of the template document.%]
[% END %]