At the moment it's not possible to use OpacUserJS with the OPAC maintenance page. It would be nice to have that.
Created attachment 90414 [details] [review] Bug 23076: Include OpacUserJS on OPAC maintenance page This patch coverts the syntax for embedding OpacUserJS in the global include file so that it uses 'Koha.Preference' syntax. This makes the data available in templates, like the OPAC maintenance page, to which the preference data has not been explicitly provided. To reproduce: Add some JavaScript to the OPACUserJS system preference which will let you know it's working. For instance: alert("OPACUserJS!"); Turn on the OPAC maintenance message using the OpacMaintenance system preference. Navigate to the OPAC. You should see the system maintenance page but you should not see an alert. To test, apply the patch and reload the OPAC page. Your alert should show.
Created attachment 90430 [details] [review] Bug 23076: Include OpacUserJS on OPAC maintenance page This patch coverts the syntax for embedding OpacUserJS in the global include file so that it uses 'Koha.Preference' syntax. This makes the data available in templates, like the OPAC maintenance page, to which the preference data has not been explicitly provided. To reproduce: Add some JavaScript to the OPACUserJS system preference which will let you know it's working. For instance: alert("OPACUserJS!"); Turn on the OPAC maintenance message using the OpacMaintenance system preference. Navigate to the OPAC. You should see the system maintenance page but you should not see an alert. To test, apply the patch and reload the OPAC page. Your alert should show. Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Created attachment 90431 [details] [review] Bug 23076: Include OpacUserJS on OPAC maintenance page This patch coverts the syntax for embedding OpacUserJS in the global include file so that it uses 'Koha.Preference' syntax. This makes the data available in templates, like the OPAC maintenance page, to which the preference data has not been explicitly provided. To reproduce: Add some JavaScript to the OPACUserJS system preference which will let you know it's working. For instance: alert("OPACUserJS!"); Turn on the OPAC maintenance message using the OpacMaintenance system preference. Navigate to the OPAC. You should see the system maintenance page but you should not see an alert. To test, apply the patch and reload the OPAC page. Your alert should show. Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: David Nind <david@davidnind.com>
Should the title now be 'Include OpacUserJS in templates'? Not understanding the nuts and bolts of this, my limited understanding as that the OPAC maintenance page is just one place it can be used.
Also, have I got the text for the release notes right?
(In reply to David Nind from comment #4) > Should the title now be 'Include OpacUserJS in templates'? OpacUserJS was available to almost all templates before this patch. I'm not sure if the maintenance page was the only one which lacked it. My patch ensures that the bug affecting the maintenance page won't affect other pages for the same reason. It would be safer to keep the title as-is. The release notes should be indicate that this is a bug fix affecting the OPAC maintenance page.
Thnaks Owen! I've updated the text for the release notes.
Created attachment 90445 [details] [review] Bug 23076: Include OpacUserJS on OPAC maintenance page This patch coverts the syntax for embedding OpacUserJS in the global include file so that it uses 'Koha.Preference' syntax. This makes the data available in templates, like the OPAC maintenance page, to which the preference data has not been explicitly provided. To reproduce: Add some JavaScript to the OPACUserJS system preference which will let you know it's working. For instance: alert("OPACUserJS!"); Turn on the OPAC maintenance message using the OpacMaintenance system preference. Navigate to the OPAC. You should see the system maintenance page but you should not see an alert. To test, apply the patch and reload the OPAC page. Your alert should show. Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Thank you for the quick fix!
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.01
backported to 18.11.x for 18.11.07