Summary: | Colon char in MARC data breaks facets | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Searching | Assignee: | Eden <eden.bacani> |
Status: | Failed QA --- | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | anne-claire.bernaudin, dcook, eden.bacani, ellawipatene, jonathan.druart, martin.renvoize, nick, sandboxes |
Version: | Main | Keywords: | Academy |
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27575 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29418 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 19684: Only replace first colon char in facets link
Bug 19684: Only replace first colon char in facets link |
Description
Fridolin Somers
2017-11-23 10:24:25 UTC
Created attachment 69301 [details] [review] Bug 19684: Only replace first colon char in facets link When a MARC data used in some facet contains colon char ":", this facet is broken it leads to no result. This is because all colon are replaced by = which is a CCL syntax char. This patch corrects by replacing only first occurence of colon char, that is the index not the data. Test plan : 1) Create a record with subject "Ainur: Yavanna" (650$a for MARC21 or 600$a for UNIMARC) 2) Index this record in Zebra 3) Perform a search that shows this subject in facets 4) Click on this facet link 5) You get the record as result I am not sure I understand the changes, how can we know it will not introduce side-effects? Tests are missing. (In reply to Jonathan Druart from comment #2) > I am not sure I understand the changes, how can we know it will not > introduce side-effects? > Tests are missing. The facets links are composed of an index and a value separated by ":", for example su:History. But real CCL syntax is index=value so ":" must be replaced by "=". But actual code replaces all ":" even in value. Test successful. Patch tested with a sandbox, by Anne-Claire Bernaudin <anne-claire.bernaudin@univ-rennes1.fr> Created attachment 72947 [details] [review] Bug 19684: Only replace first colon char in facets link When a MARC data used in some facet contains colon char ":", this facet is broken it leads to no result. This is because all colon are replaced by = which is a CCL syntax char. This patch corrects by replacing only first occurence of colon char, that is the index not the data. Test plan : 1) Create a record with subject "Ainur: Yavanna" (650$a for MARC21 or 600$a for UNIMARC) 2) Index this record in Zebra 3) Perform a search that shows this subject in facets 4) Click on this facet link 5) You get the record as result Signed-off-by: Anne-Claire Bernaudin <anne-claire.bernaudin@univ-rennes1.fr> Unit tests needed Still valid ? Arf limit may contain serveral blocks. Maybe we should move this replacement in : foreach my $this_limit (@limits) { |