Summary: | Link to edit OpacLibraryInfo from library edit page broken | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | System Administration | Assignee: | Owen Leonard <oleonard> |
Status: | Signed Off --- | QA Contact: | Lisette Scheer <lisette> |
Severity: | major | ||
Priority: | P5 - low | CC: | baptiste.wojtkowski, david, gmcharlt, lisette, lucas, phil |
Version: | Main | Keywords: | additional_work_needed |
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32887 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40460 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
This fixes editing and showing OpacLibraryInfo HTML customizations information in the staff interface and OPAC:
1. Staff interface:
- When editing a library (Koha administration > Libraries > Actions > Edit)
. the links to edit OpacLibraryInfo entries for the OPAC information field are now correct (previously, they may have linked to an incorrect HTML customization)
. if there is more than one OpacLibraryInfo entry, all entries are now shown (only one entry was shown previously)
- When viewing library information (Koha administration > Libraries > Name > [click library name]), all the OpacLibraryInfo entries are now shown
2. OPAC:
- All the entries for a library (including any 'All libraries' entries for OpacLibraryInfo) are now shown on the library information page (from the 'Libraries' link under the quick search bar)
- In a record's holdings table, the pop-up window when you click on the current library for an item now correctly shows all entries
|
|
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page
Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page Bug 39482: (follow-up) Adjust tests |
Description
Owen Leonard
2025-03-28 16:30:30 UTC
Equally bad but more confusing, it seems to be the wrong id parameter unless the right one is currently the highest number there has ever been. When you you go to test it in ktd, you have to create an OpacLibraryInfo page, and then you see that your link has the right id, 7. Create another sort of HTML customization page, and now the link is wrongly id 9. Delete that second one, your link is still 9. Created attachment 185452 [details] [review] Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page When editing a library which has an associated OpacLibraryInfo HTML customization the "Edit HTML content" link passes the wrong id parameter. To test, apply the patch and restart services. - Rebuild OPAC CSS. - Go to Administration -> Libraries. - Edit a library. - If there is no OpacLibraryInfo customization associated with that library, add at least two OpacLibraryInfo entries and then return to the library edit form. - By the "OPAC information" label you should see all of the OpacLibraryInfo entries you added for that library. - If you have permission to edit HTML customizations you should see an edit link. - Test each to confirm that it opens the correct entry for editing. - Return to Administration -> Libraries and click the library name to view it (rather than edit). - The correct HTML customizations should appear. If you have permission to edit HTML customizations you should see corresponding "Edit" links. - Test each to confirm that it opens the correct entry for editing. - In the OPAC, locate a bibliographic record which has one or more items from the library you added OpacLibraryInfo to. - In the holdings table, click the one of the library links to trigger the info modal. - Confirm that all the correct information displays. - Go to "Libraries" link in the menu under the quick search bar. - Click the library you modified. Confirm that the correct OpacLibraryInfo entries display. Sponsored-by: Athens County Public Libraries This necessitates a change to t/db_dependent/Koha/Library.t but I'm not sure how to do that! Created attachment 185484 [details] [review] Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page When editing a library which has an associated OpacLibraryInfo HTML customization the "Edit HTML content" link passes the wrong id parameter. To test, apply the patch and restart services. - Rebuild OPAC CSS. - Go to Administration -> Libraries. - Edit a library. - If there is no OpacLibraryInfo customization associated with that library, add at least two OpacLibraryInfo entries and then return to the library edit form. - By the "OPAC information" label you should see all of the OpacLibraryInfo entries you added for that library. - If you have permission to edit HTML customizations you should see an edit link. - Test each to confirm that it opens the correct entry for editing. - Return to Administration -> Libraries and click the library name to view it (rather than edit). - The correct HTML customizations should appear. If you have permission to edit HTML customizations you should see corresponding "Edit" links. - Test each to confirm that it opens the correct entry for editing. - In the OPAC, locate a bibliographic record which has one or more items from the library you added OpacLibraryInfo to. - In the holdings table, click the one of the library links to trigger the info modal. - Confirm that all the correct information displays. - Go to "Libraries" link in the menu under the quick search bar. - Click the library you modified. Confirm that the correct OpacLibraryInfo entries display. Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind <david@davidnind.com> Is Bug 40460 - Link from branch edition toward OPAC personnalisation is broken, the same a this one? I was not aware of Bug 40460, but it is a duplicate. However, I think this patch is more complete because it accommodates cases where there is more than one HTML customization for one library. Created attachment 185561 [details] [review] Bug 39482: Correct the link to edit OpacLibraryInfo from library edit page When editing a library which has an associated OpacLibraryInfo HTML customization the "Edit HTML content" link passes the wrong id parameter. To test, apply the patch and restart services. - Rebuild OPAC CSS. - Go to Administration -> Libraries. - Edit a library. - If there is no OpacLibraryInfo customization associated with that library, add at least two OpacLibraryInfo entries and then return to the library edit form. - By the "OPAC information" label you should see all of the OpacLibraryInfo entries you added for that library. - If you have permission to edit HTML customizations you should see an edit link. - Test each to confirm that it opens the correct entry for editing. - Return to Administration -> Libraries and click the library name to view it (rather than edit). - The correct HTML customizations should appear. If you have permission to edit HTML customizations you should see corresponding "Edit" links. - Test each to confirm that it opens the correct entry for editing. - In the OPAC, locate a bibliographic record which has one or more items from the library you added OpacLibraryInfo to. - In the holdings table, click the one of the library links to trigger the info modal. - Confirm that all the correct information displays. - Go to "Libraries" link in the menu under the quick search bar. - Click the library you modified. Confirm that the correct OpacLibraryInfo entries display. Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> *** Bug 40460 has been marked as a duplicate of this bug. *** Nice work everyone! Pushed to main for 25.11 This breaks tests: prove -v /kohadevbox/koha/t/db_dependent/Koha/Library.t # Subtest: opac_info tests 1..8 # No tests run! not ok 2 - No tests run for subtest "opac_info tests" # Failed test 'No tests run for subtest "opac_info tests"' # at /kohadevbox/koha/t/db_dependent/Koha/Library.t line 176. The method Koha::AdditionalContentsLocalizations->content is not covered by tests! (In reply to Owen Leonard from comment #3) > This necessitates a change to t/db_dependent/Koha/Library.t but I'm not sure > how to do that! Sorry Owen, I missed this comment before pushing. For the time being I am reverting this until we can figure out how to adjust those tests. For tests, since it is now returning a set of results instead of the best match I think we can get opac_info as a list and check the first thing returned in the array which should be the best result. (In reply to Lucas Gass (lukeg) from comment #12) > For tests, since it is now returning a set of results instead of the best > match I think we can get opac_info as a list and check the first thing > returned in the array which should be the best result. Or maybe not. search_for_display does not seem to return a consistent order. Created attachment 185674 [details] [review] Bug 39482: (follow-up) Adjust tests Adjusted a test but let's set it back to 'Signed-off' so someone can double check those tests. |