Bug 18434 - Followup - same changes for sort and facet fields

To test:
1 - Index some stuff with multiple fields defined for sorting
  i.e. Authorites - make heading sortable - default is 110a and 111a for
  heading - a record with 111a empty will make the sort field empty
2 - view the record:
curl http://localhost:9200/koha_kohadev_authorities/data/30?pretty=true
3 - Note the blank field
4 - Apply patch
5 - Reindex
6 - Fields should be correctly populated

Unit tests to follow (once I have the originals working for all)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 241be8ff1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2017-06-16 10:01:12 -04:00 committed by Fridolin Somers
parent 7feb5654eb
commit 794bb066aa
1 changed files with 2 additions and 2 deletions

View File

@ -328,7 +328,7 @@ sub get_fixer_rules {
$options = '-split => 1' unless $marc_field =~ m|_/| || $type eq 'sum';
push @rules, "marc_map('$marc_field','${name}.\$append', $options)";
if ($facet) {
push @rules, "marc_map('$marc_field','${name}__facet', $options)";
push @rules, "marc_map('$marc_field','${name}__facet.\$append', $options)";
}
if ($suggestible) {
push @rules,
@ -351,7 +351,7 @@ sub get_fixer_rules {
# to do the default thing, which is make it sortable.
if ($self->sort_fields()->{$name}) {
if ($sort || !defined $sort) {
push @rules, "marc_map('$marc_field','${name}__sort', $options)";
push @rules, "marc_map('$marc_field','${name}__sort.\$append', $options)";
}
}
}