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
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) {