diff --git a/src/FacetManager/DefaultFacetManager.php b/src/FacetManager/DefaultFacetManager.php index c2dab74..3dee854 100644 --- a/src/FacetManager/DefaultFacetManager.php +++ b/src/FacetManager/DefaultFacetManager.php @@ -293,19 +293,17 @@ class DefaultFacetManager { $results = $facet->getResults(); $active_sorts = []; + $processors = $facet->getProcessors(); foreach ($facet->getProcessorsByStage(ProcessorInterface::STAGE_BUILD) as $processor) { /** @var \Drupal\facets\Processor\BuildProcessorInterface $build_processor */ $build_processor = $this->processorPluginManager->createInstance($processor->getPluginDefinition()['id'], ['facet' => $facet]); if ($build_processor instanceof WidgetOrderProcessorInterface) { // Sorting is handled last and together, to support nested sorts. - // @todo For some reason getProcessorsByStage does not return the - // correct configuration, thats why we use getProcessors() below. - $processors = $facet->getProcessors(); $active_sorts[] = $processors[$build_processor->getPluginId()]; } else { if (!$build_processor instanceof BuildProcessorInterface) { - throw new InvalidProcessorException(new FormattableMarkup("The processor @processor has a build definition but doesn't implement the required BuildProcessorInterface interface", ['@processor' => $processor->getPluginDefinition()['id']])); + throw new InvalidProcessorException("The processor {$processor->getPluginDefinition()['id']} has a build definition but doesn't implement the required BuildProcessorInterface interface"); } $results = $build_processor->build($facet, $results); }