Bug 20351: Shortcut serials scripts if a blocking error appeared
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 May 2018 17:25:57 +0000 (14:25 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 26 Oct 2018 13:15:15 +0000 (14:15 +0100)
commit8969eccaaeddfffbdc30a2f36e6dfc64595d607e
tree867d4617eb3b49e8f180c142fec04a0ac4e05c8d
parent81ceef6b8410988dbf14ae0db3dfac64ae084fc9
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>
(cherry picked from commit 62285d2de463811380262e4cc65c82937145d477)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
12 files changed:
C4/Serials.pm
koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc
koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt
serials/routing.pl
serials/serials-collection.pl
serials/serials-edit.pl
serials/subscription-add.pl
serials/subscription-detail.pl
serials/subscription-renew.pl