For example if there is an error in the opac_js hook, it will break the OPAC with an internal server error on all pages, not only the one the hook is used on.
Created attachment 145328 [details] [review] Bug 32539: Add exception handling to plugin hooks in template plugin This change wraps Koha plugin hook calls with exception handling within the template plugin for Koha plugins. Test plan: 0) Apply patch 1) Install a plugin that provides "opac_head", "opac_js", "intranet_head", and "intranet_js" with Perl errors in them 2) Load an OPAC page 3) Note that the OPAC page loads correctly 4) Load a staff interace page 5) Note that the staff interface page loads correctly
Created attachment 145329 [details] Koha plugin to use for testing this patch Koha plugin to use for testing this patch
Created attachment 145366 [details] [review] Bug 32539: Add exception handling to plugin hooks in template plugin This change wraps Koha plugin hook calls with exception handling within the template plugin for Koha plugins. Test plan: 0) Apply patch 1) Install a plugin that provides "opac_head", "opac_js", "intranet_head", and "intranet_js" with Perl errors in them 2) Load an OPAC page 3) Note that the OPAC page loads correctly 4) Load a staff interace page 5) Note that the staff interface page loads correctly Signed-off-by: David Nind <david@davidnind.com>
Thanks David for providing a plugin to test this with!
Created attachment 146423 [details] [review] Bug 32539: Add exception handling to plugin hooks in template plugin This change wraps Koha plugin hook calls with exception handling within the template plugin for Koha plugins. Test plan: 0) Apply patch 1) Install a plugin that provides "opac_head", "opac_js", "intranet_head", and "intranet_js" with Perl errors in them 2) Load an OPAC page 3) Note that the OPAC page loads correctly 4) Load a staff interace page 5) Note that the staff interface page loads correctly Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 146424 [details] [review] Bug 32539: Add tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Backported to 22.05.x for upcoming 22.05.10
applied to 21.11.x for 21.11.18
Not backported to 21.05.x