Skip to content

Commit

Permalink
Fixed list of available sort and facet fields (fix Daniel-KM/Omeka-S-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Oct 14, 2024
1 parent 95c5306 commit 7713c53
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/Adapter/SolariumAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,7 @@ public function getAvailableSortFieldsForSelect(): array
$schema = $solrCore->schema();

$sortFields = [
'relevance desc' => [
'name' => 'relevance desc',
'label' => $this->translator->translate('Relevance'),
],
'relevance desc' => $this->translator->translate('Relevance'),
];

$directionLabel = [
Expand All @@ -249,10 +246,9 @@ public function getAvailableSortFieldsForSelect(): array
$fieldLabel = $map->setting('label', '');
foreach ($directionLabel as $direction => $labelDirection) {
$name = $fieldName . ' ' . $direction;
$sortFields[$name] = [
'name' => $name,
'label' => $fieldLabel ? sprintf($this->translator->translate('%1$s (%2$s)'), $fieldLabel . ' ' . $labelDirection, $name) : $name,
];
$sortFields[$name] = $fieldLabel
? sprintf($this->translator->translate('%1$s (%2$s)'), $fieldLabel . ' ' . $labelDirection, $name)
: $name;
}
}

Expand Down Expand Up @@ -282,10 +278,7 @@ public function getAvailableFacetFieldsForSelect(): array
continue;
}
$fieldLabel = $map->setting('label', '');
$fields[$name] = [
'name' => $name,
'label' => sprintf($this->translator->translate('%1$s (%2$s)'), $fieldLabel, $name),
];
$fields[$name] = sprintf($this->translator->translate('%1$s (%2$s)'), $fieldLabel, $name);
}

return $fields;
Expand Down

1 comment on commit 7713c53

@coret
Copy link

@coret coret commented on 7713c53 Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci, solves the search config persistency issue indeed!

Please sign in to comment.