| Summary: | System preference AuthorLinkSortBy is not working for UNIMARC or custom XSLT | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Marion Durand <marion.durand> |
| Component: | Searching | Assignee: | Marion Durand <marion.durand> |
| Status: | Pushed to oldstable --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
| Severity: | minor | ||
| Priority: | P5 - low | CC: | david, fridolin.somers, m.de.rooy |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Small patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: |
This fixes the default UNIMARC XSLT files so that the AuthorLinkSortBy and AuthorLinkSortOrder system preferences now work with UNIMARC, not just MARC21.
A note was also added to the system preference for those that use custom XSLT (for OPACXSLTDetailsDisplay, OPACXSLTResultsDisplay, XSLTDetailsDisplay, and XSLTResultsDisplay) - they need to update their templates to support these features for both MARC21 and UNIMARC.
(These preferences were added in Koha 23.11 by Bug 33217 - Allow different default sorting when click author links, but only the default XSLT files for MARC21 were updated.)
|
|
| Version(s) released in: |
25.11.00,25.05.03,24.11.09
|
Circulation function: | |
| Bug Depends on: | 33217 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 39896: Add UNIMARC support for AuthorLinkSortBy
Bug 39896: Add UNIMARC support for AuthorLinkSortBy Bug 39896: Add UNIMARC support for AuthorLinkSortBy |
||
|
Description
Marion Durand
2025-05-14 10:00:43 UTC
As you write it cannot really be changed unless they implement it, which they could. Maybe a hint: If you are using custom XSLT you need to make sure the system preference check is implemented. ? I think there is two part (maybe I should have files tow bug ?) : default UNIMARC files (provided in Koha code) and libraries using custom XSLT files. I will try to provide a patch for the default UNIMARC files. (In reply to Katrin Fischer from comment #1) > As you write it cannot really be changed unless they implement it, which > they could. Maybe a hint: If you are using custom XSLT you need to make sure > the system preference check is implemented. ? Yes, I think we could add a hint either on the syspref description or in the manuel. It would help understand why the syspref has no effect in certains cases. Hi Marion, if you want to split, that's fine, but I think a textual hint would be OK as part of the UNIMARC patch as well being low risk. Hi Katrin, If it can be done with the UNIMARC patch, I can do that too. Thank you for your help :) Created attachment 182479 [details] [review] Bug 39896: Add UNIMARC support for AuthorLinkSortBy This patch add support for AuthorLinkSortBy and AuthorLinkSortOrder in the default UNIMARC XSLT files. The description of the syspref is also slighly updated to hint users of custom XSLT file about the need to update their template. To test: 0. On a UNIMARC database 1. Set AuthorLinkSortBy to 'title' and AuthorLinkSortORder to 'descending' 2. On the intranet and OPAC, search for an author you have multiple titles from and click on a result 3. Click on a link one a name for an author 4. Note a new search is performed, sorted by field from defaultSortField preference and not by title descending 5. Apply the patch 6. restart_all 7. Check that the syspref description now include a note about custom XSLT files 8. Repeat step 2 and 3 9. Note a new search is performed, sorted by title descending 10. Test other values - confirm links are updated in both staff and opac Added assignee. Created attachment 182884 [details] [review] Bug 39896: Add UNIMARC support for AuthorLinkSortBy This patch add support for AuthorLinkSortBy and AuthorLinkSortOrder in the default UNIMARC XSLT files. The description of the syspref is also slighly updated to hint users of custom XSLT file about the need to update their template. To test: 0. On a UNIMARC database 1. Set AuthorLinkSortBy to 'title' and AuthorLinkSortORder to 'descending' 2. On the intranet and OPAC, search for an author you have multiple titles from and click on a result 3. Click on a link one a name for an author 4. Note a new search is performed, sorted by field from defaultSortField preference and not by title descending 5. Apply the patch 6. restart_all 7. Check that the syspref description now include a note about custom XSLT files 8. Repeat step 2 and 3 9. Note a new search is performed, sorted by title descending 10. Test other values - confirm links are updated in both staff and opac Signed-off-by: David Nind <david@davidnind.com> Testing notes (using KTD): 1. To start up KTD with UNIMARC, edit your .env file and set KOHA_MARC_FLAVOUR=unimarc 2. An author with multiple records: Louis Gardel Just wondering here about: -rw-r--r-- 1 root root 107578 Jul 15 16:07 MARC21slim2intranetDetail.xsl -rw-r--r-- 1 root root 55899 Jun 11 14:04 MARC21slim2intranetResults.xsl -rw-r--r-- 1 root root 21525 Jul 18 09:29 UNIMARCslim2intranetDetail.xsl -rw-r--r-- 1 root root 3304 Jun 11 14:04 UNIMARCslim2intranetResults.xsl What is actually the current status of UNIMARCslim2intranetResults.xsl ? It is adjusted in MARC21 for the AuthorLinkSort stuff too.. Although the code looks good to me, I would appreciate a response about the current status of using XSLT for OPAC and intranet on UNIMARC installs. (In reply to Marcel de Rooy from comment #10) > Although the code looks good to me, I would appreciate a response about the > current status of using XSLT for OPAC and intranet on UNIMARC installs. I'm not sure to understand your question, we often use XSLT in UNIMARC installation. Sometimes with community file, sometimes with custom file. This patch adjusted the following files to add support for the syspref in default UNIMARC XSLT. prog/en/xslt/UNIMARCslim2intranetDetail.xsl prog/en/xslt/UNIMARCslimUtils.xsl bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl bootstrap/en/xslt/UNIMARCslimUtils.xsl (plus /en/modules/admin/preferences/searching.pref to add a hint in the syspref for custom file). I did not updated the following files as the author search link is not present in the first place (so no need to add parameters to this link) prog/en/xslt/UNIMARCslim2intranetResults.xsl bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl (In reply to Marion Durand from comment #11) > (In reply to Marcel de Rooy from comment #10) > > Although the code looks good to me, I would appreciate a response about the > > current status of using XSLT for OPAC and intranet on UNIMARC installs. > > I'm not sure to understand your question, we often use XSLT in UNIMARC > installation. Sometimes with community file, sometimes with custom file. Looking at the UNIMARC community files, I wonder why they are so small (as compared to their MARC21 counterparts). Are they actually used somewhere, or generally replaced by customization? I listed staff above, here is OPAC: -rw-r--r-- 1 root root 123416 Jul 15 16:07 MARC21slim2OPACDetail.xsl -rw-r--r-- 1 root root 86887 Jul 15 16:07 MARC21slim2OPACResults.xsl -rw-r--r-- 1 root root 40052 Jul 15 16:07 MARC21slimUtils.xsl -rw-r--r-- 1 root root 25784 Jul 18 09:51 UNIMARCslim2OPACDetail.xsl -rw-r--r-- 1 root root 19112 Jun 11 14:04 UNIMARCslim2OPACResults.xsl -rw-r--r-- 1 root root 20546 Jul 18 09:51 UNIMARCslimUtils.xsl For instance OPACDetail is 5x smaller. (In reply to Marcel de Rooy from comment #12) > (In reply to Marion Durand from comment #11) > > (In reply to Marcel de Rooy from comment #10) > > > Although the code looks good to me, I would appreciate a response about the > > > current status of using XSLT for OPAC and intranet on UNIMARC installs. > > > > I'm not sure to understand your question, we often use XSLT in UNIMARC > > installation. Sometimes with community file, sometimes with custom file. > > Looking at the UNIMARC community files, I wonder why they are so small (as > compared to their MARC21 counterparts). Are they actually used somewhere, or > generally replaced by customization? > > I listed staff above, here is OPAC: > -rw-r--r-- 1 root root 123416 Jul 15 16:07 > MARC21slim2OPACDetail.xsl > -rw-r--r-- 1 root root 86887 Jul 15 16:07 > MARC21slim2OPACResults.xsl > -rw-r--r-- 1 root root 40052 Jul 15 16:07 > MARC21slimUtils.xsl > -rw-r--r-- 1 root root 25784 Jul 18 09:51 > UNIMARCslim2OPACDetail.xsl > -rw-r--r-- 1 root root 19112 Jun 11 14:04 > UNIMARCslim2OPACResults.xsl > -rw-r--r-- 1 root root 20546 Jul 18 09:51 > UNIMARCslimUtils.xsl > > For instance OPACDetail is 5x smaller. They are used but, as it was the case here, many functionalities are added in MARC21 but not in UNIMARC. These files might also be simpler with less information (or link) displayed. Created attachment 184424 [details] [review] Bug 39896: Add UNIMARC support for AuthorLinkSortBy This patch add support for AuthorLinkSortBy and AuthorLinkSortOrder in the default UNIMARC XSLT files. The description of the syspref is also slighly updated to hint users of custom XSLT file about the need to update their template. To test: 0. On a UNIMARC database 1. Set AuthorLinkSortBy to 'title' and AuthorLinkSortORder to 'descending' 2. On the intranet and OPAC, search for an author you have multiple titles from and click on a result 3. Click on a link one a name for an author 4. Note a new search is performed, sorted by field from defaultSortField preference and not by title descending 5. Apply the patch 6. restart_all 7. Check that the syspref description now include a note about custom XSLT files 8. Repeat step 2 and 3 9. Note a new search is performed, sorted by title descending 10. Test other values - confirm links are updated in both staff and opac Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Thx for your feedback. Passing QA. Just wondering if + - "<br /><strong>NOTE:</strong> If you are using custom XSLT you need to make sure the system preference check is implemented." this is clear enough. But can be improved later. What a dev probably needs to do, is pass those pref values to the relevant template (showAuthor or tag_7xx etc.) Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x Pushed to 24.11.x for 24.11.09 |