Comment 2 for bug 1847343

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Working branch user/jeffdavis/lp1847343-exclude-eresources-fix has a fix:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jeffdavis/lp1847343-exclude-eresources-fix

I'm not 100% sure why the locale picker causes problems but I assume there are issues removing multiple hidden input elements. Adding type="hidden" as a criterion and switching from getElementsByName to querySelectorAll in the exclude_onchange() function seems to do the trick.

Test plan:
[1] In config.tt2, enable Exclude Electronic Resources checkbox: ctx.exclude_electronic_checkbox = 1;
[2] In eg_vhost.conf, under <Location /eg>, uncomment OILSWebLocale entries to enable multiple locales and display the locale picker.
[3] Restart Apache.
[4] Do a search.
[5] On the results page, check the "Exclude Electronic Resources" box. The page will refresh as your search is resubmitted with e-resources excluded.
[6] On the new results page, uncheck the "Exclude Electronic Resources" box. The checkbox disappears, the page is not refreshed, and the JS console shows a "TypeError: checkbox.form is null" error on exclude_onchange().
[7] Apply the fix.
[8] Clear cache and repeat steps 4-6. Unchecking the "Exclude Electronic Resources" box should now refresh the page to show results including electronic resources.