When you go to subscription details, like cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=108 and use a subscriptionid which is not in the subscriptions table you get an empty subscription item, but should get a page telling you the subscription doesn't exist.
Created attachment 75178 [details] [review] 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
Created attachment 75185 [details] [review] 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
I did an attempt to set up a sandbox and sign it off, but got this result. The sandbox you've requested is not ready. Some problems occurred applying patches from bug 20351: <h1>Something went wrong !</h1>Applying: Bug 20351: Shortcut serials scripts if a blocking error appeared .git/rebase-apply/patch:61: trailing whitespace. .git/rebase-apply/patch:107: trailing whitespace. .git/rebase-apply/patch:120: trailing whitespace. fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc). error: could not build fake ancestor Patch failed at 0001 Bug 20351: Shortcut serials scripts if a blocking error appeared The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run git bz apply --continue. If you would prefer to skip this patch, instead run git bz apply --skip. To restore the original branch and stop patching run git bz apply --abort. Bug 20351 - Implement blocking errors for serials scripts 75185 - Bug 20351: Shortcut serials scripts if a blocking error appeared Apply? [(y)es, (n)o, (i)nteractive] Patch left in /tmp/Bug-20351-Shortcut-serials-scripts-if-a-blocking-e-EBl7TX.patch .
Created attachment 75274 [details] [review] 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
(In reply to Maria from comment #3) > I did an attempt to set up a sandbox and sign it off, but got this result. > You need to apply patches from bug 20661 and bug 20730 first.
Patch doesn't apply, can you please fix?
Created attachment 78344 [details] [review] 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
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 78887 [details] [review] 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>
Created attachment 80371 [details] [review] 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>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.06
Depends on Bug 20661 not in 17.11.x