In 24.05 it worked, in 24.11 it doesn't. No changes in Koha/opac/opac-browse.pl or Koha/koha-tmpl/opac-tmpl/bootstrapjs/browse.js. It seems that the on-click event and loading the results into HTML works, what's broken is that the "collapse" feature, that seemed to be automatic based on jQuery classes or something, is not working anymore. Possibly browse.js might need to toggle the visibility of the expanded view manually now...? At least I don't see anything in the code explicitly expanding the things now.
Problem and solution found: in 24.11, for Bootstrap update, `data-toggle` was changed to `data-bs-toggle`. However, `data-target` was not changed to `data-bs-target`. After changing that in inspector of web tools, it works again. The `data-target` is added in browse.js separately from the .tt template, so it was missed during the HTML refactoring.
Also in .tt change `data-parent` to `data-bs-parent`
Created attachment 183112 [details] [review] Bug 39223: opac-browse.pl broken Test Plan: 1. Ensure your KTD is set up to use elastic search. 2. In the System Preferences, navigate to Administration Preferences and locate SearchEngine Set this to use Elastic Search and save. In the System Preferences, navigate to OPAC preferences and locate opacBrowseSearch and enable this setting and save. You may need to refresh the page in the opac - from the home page. Click 'Browse Search' Type in an Author to search for and click search Click on one of the names that displays and notice that nothing happens. Apply the patch Refresh the page in the opac and repeat steps 11 ans 12 and notice that the author section now drops down.
Created attachment 183122 [details] [review] Bug 39223: opac-browse.pl broken Signing off, since the modification is based on my findings/notes above.
Created attachment 183123 [details] [review] Bug 39223: opac-browse.pl broken Test Plan: 1. Ensure your KTD is set up to use elastic search. 2. In the System Preferences, navigate to Administration Preferences and locate SearchEngine 3. Set this to use Elastic Search and save. 4. In the System Preferences, navigate to OPAC preferences and locate opacBrowseSearch and enable this setting and save. You may need to refresh the page in the opac - from the home page. 5. Click 'Browse Search' 6. Type in an Author to search for and click search 7. Click on one of the names that displays and notice that nothing happens. 8. Apply the patch 9. Refresh the page in the opac and repeat steps 11 and 12 and notice that the author section now drops down and related titles are displayed.
Re submitted to correct the dropdown not showing the related titles.
Created attachment 183223 [details] [review] Bug 39223: Fix the OPAC browse search (opac-browse.pl) This fixes the OPAC browse search feature (OpacBrowseSearch system preference, Elasticsearch only). Expanding and collapsing the search results was not working. Test plan: 1. Start up KTD using Elasticsearch; ktd --es7 up 2. Enable the OpacBrowseSearch system preference. 3. In the OPAC, click 'Browse search' (one of the options under the search box). 4. Search for 'a', for the search type use Author, then click Search. 5. Click on one of the search results - note that it doesn't expand to show the titles for the author. 6. Apply the patch. 7. Refresh the page and repeat steps 3 to 5. Note that the author section now expands andd collapses when clicked, and that the titles for the author are now shown. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 183461 [details] [review] Bug 39223: Fix the OPAC browse search (opac-browse.pl) This fixes the OPAC browse search feature (OpacBrowseSearch system preference, Elasticsearch only). Expanding and collapsing the search results was not working. Test plan: 1. Start up KTD using Elasticsearch; ktd --es7 up 2. Enable the OpacBrowseSearch system preference. 3. In the OPAC, click 'Browse search' (one of the options under the search box). 4. Search for 'a', for the search type use Author, then click Search. 5. Click on one of the search results - note that it doesn't expand to show the titles for the author. 6. Apply the patch. 7. Refresh the page and repeat steps 3 to 5. Note that the author section now expands andd collapses when clicked, and that the titles for the author are now shown. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Nice work everyone! Pushed to main for 25.11