Created attachment 99461 [details] Screenshots - Checkbox not visible in staff interface search results The checkbox for selecting records for the standard search results in the staff interface is no longer visible. Checked on latest Firefox, Chromium, and Google Chrome on Ubuntu 18.04. I've only noticed this in the last few days - it is fine in 19.11.x and at least a week ago in master. See the screenshots attached.
Git blames me and Bug 23885
Created attachment 99604 [details] [review] Bug 24713: JavaScript error on staff client catalog search results page This patch modifies the output of template toolkit variables so that values in the in-page JavaScript are quoted. This avoids JavaScript errors when the template variable is empty. To test, apply the patch and perform a catalog search in the staff client. Use the browser's developer tool to check for JavaScript errors in the console. There should be none. Test with AmazonCoverImages both on and off.
QA tool reports an error which I assume is unrelated: FAIL valid_template Attempt to reload Koha/Template/Plugin/Biblio.pm aborted. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Plugins.pm line 206. Please correct me if I'm wrong.
To recreate: 1 - Set AmazonCoverImages to "Show" 2 - Set AmazonCoverImages to "Don't show" 3 - Check the DB, the pref is now "" select * from systempreferences where variable like '%amazoncover%'; 4 - Do a search on the staff client 5 - Note checkboxes are missing and there is a JS error I wonder if the problem is that we set the value for "Don't show" as "" (blank string) instead of 0
I do not recreate this error, however I got it yesterday and fixed it. See commit 884ab0d98e54d3a9f5229e2d21fd234dddf298b0 Bug 23777: (follow-up) Use To.json in results.tt
Created attachment 99631 [details] [review] Bug 24713: JavaScript error on staff client catalog search results page This patch modifies the output of template toolkit variables so that values in the in-page JavaScript are quoted. This avoids JavaScript errors when the template variable is empty. To test, apply the patch and perform a catalog search in the staff client. Use the browser's developer tool to check for JavaScript errors in the console. There should be none. Test with AmazonCoverImages both on and off. Signed-off-by: David Nind <david@davidnind.com>
Was just about to post - it seems that this was fixed over the last few days (one of the commits since since Saturday). I've signed it off, but feel free to close if this is not required anymore.
*** This bug has been marked as a duplicate of bug 23777 ***
(In reply to Jonathan Druart from comment #5) > I do not recreate this error, however I got it yesterday and fixed it. > See > commit 884ab0d98e54d3a9f5229e2d21fd234dddf298b0 > Bug 23777: (follow-up) Use To.json in results.tt Bug 23777 has been pushed to master but this is still a problem. Reopening.
(In reply to Nick Clemens from comment #4) > To recreate: > 1 - Set AmazonCoverImages to "Show" > 2 - Set AmazonCoverImages to "Don't show" => I get '0', and so I still do not recreate the bug. I think the patch is valid however, but I'd like to understand why it works for me. Can you confirm those steps are sufficient to recreate the problem? Which OS?
I am running koha-testing-docker with KOHA_IMAGE=master with docker-compose.yml and docker-compose.mariadb_d9.yml
(In reply to Jonathan Druart from comment #11) > I am running koha-testing-docker with KOHA_IMAGE=master with > docker-compose.yml and docker-compose.mariadb_d9.yml I am using docker-compose.mariadb_d10.yml
(In reply to Nick Clemens from comment #12) > (In reply to Jonathan Druart from comment #11) > > I am running koha-testing-docker with KOHA_IMAGE=master with > > docker-compose.yml and docker-compose.mariadb_d9.yml > > I am using docker-compose.mariadb_d10.yml For the record: Nick is using Debian 9 with mariaDB for Debian 10 Owen, what about you?
The question is only whether or not the value returned by the system preference check is going to trigger the error or not. If the value for AmazonCoverImages is '', the error will happen. If it's 0 or 1 it won't.
(In reply to Owen Leonard from comment #14) > The question is only whether or not the value returned by the system > preference check is going to trigger the error or not. If the value for > AmazonCoverImages is '', the error will happen. If it's 0 or 1 it won't. It's more about fixing this specific error or other possible occurrences where prefs can be an empty strings (when 0 is expected).
Created attachment 100218 [details] [review] Bug 24713: JavaScript error on staff client catalog search results page This patch modifies the output of template toolkit variables so that values in the in-page JavaScript are quoted. This avoids JavaScript errors when the template variable is empty. To test, apply the patch and perform a catalog search in the staff client. Use the browser's developer tool to check for JavaScript errors in the console. There should be none. Test with AmazonCoverImages both on and off. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
git grep -l -E "parseInt\(\s*\[%" Before koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt After Nothing
(In reply to Marcel de Rooy from comment #17) > git grep -l -E "parseInt\(\s*\[%" > Before > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt > > After > Nothing You should also search for var xxx = [% Koha.Preference('xxx') %]
Nice work everyone! Pushed to master for 20.05
does not apply to 19.11.x branch. please rebase if needed.