Skip to content
Snippets Groups Projects
Commit aca9c6af authored by Joris Vercammen's avatar Joris Vercammen Committed by Joris Vercammen
Browse files

Issue #2913376 by borisson_: Facets Summary processor plugin docblocks need to be updated

parent 4dd25dc5
Branches
Tags
No related merge requests found
......@@ -7,7 +7,7 @@ use Drupal\facets_summary\Processor\BuildProcessorInterface;
use Drupal\facets_summary\Processor\ProcessorPluginBase;
/**
* Provides a processor that hides the facet when the facets were not rendered.
* Provides a processor that hides the summary when the source was not rendered.
*
* @SummaryProcessor(
* id = "hide_when_not_rendered",
......
......@@ -10,7 +10,7 @@ use Drupal\facets_summary\Processor\BuildProcessorInterface;
use Drupal\facets_summary\Processor\ProcessorPluginBase;
/**
* Provides a processor that allows to reset facet filters.
* Provides a processor that adds a link to reset facet filters.
*
* @SummaryProcessor(
* id = "reset_facets",
......
......@@ -7,7 +7,7 @@ use Drupal\facets_summary\Processor\BuildProcessorInterface;
use Drupal\facets_summary\Processor\ProcessorPluginBase;
/**
* Provides a processor that hides the facet when the facets were not rendered.
* Provides a processor that shows a summary of how many results were found.
*
* @SummaryProcessor(
* id = "show_count",
......
......@@ -7,7 +7,7 @@ use Drupal\facets_summary\Processor\BuildProcessorInterface;
use Drupal\facets_summary\Processor\ProcessorPluginBase;
/**
* Provides a processor that hides the facet when the facets were not rendered.
* Provides a processor that shows a summary of all selected facets.
*
* @SummaryProcessor(
* id = "show_summary",
......@@ -26,7 +26,10 @@ class ShowSummaryProcessor extends ProcessorPluginBase implements BuildProcessor
public function build(FacetsSummaryInterface $facets_summary, array $build, array $facets) {
$facets_config = $facets_summary->getFacets();
if (isset($build['#items'])) {
if (!isset($build['#items'])) {
return $build;
}
/** @var \Drupal\facets\Entity\Facet $facet */
foreach ($facets as $facet) {
if (empty($facet->getActiveItems())) {
......@@ -43,7 +46,6 @@ class ShowSummaryProcessor extends ProcessorPluginBase implements BuildProcessor
];
array_unshift($build['#items'], $facet_summary);
}
}
return $build;
}
......
......@@ -8,7 +8,7 @@ use Drupal\facets_summary\Processor\BuildProcessorInterface;
use Drupal\facets_summary\Processor\ProcessorPluginBase;
/**
* Provides a processor that hides the facet when the facets were not rendered.
* Provides a processor that shows a text when there are no results.
*
* @SummaryProcessor(
* id = "show_text_when_empty",
......@@ -28,7 +28,10 @@ class ShowTextWhenEmptyProcessor extends ProcessorPluginBase implements BuildPro
public function build(FacetsSummaryInterface $facets_summary, array $build, array $facets) {
$config = $this->getConfiguration();
if (!isset($build['#items'])) {
if (isset($build['#items'])) {
return $build;
}
return [
'#theme' => 'facets_summary_empty',
'#message' => [
......@@ -38,8 +41,6 @@ class ShowTextWhenEmptyProcessor extends ProcessorPluginBase implements BuildPro
],
];
}
return $build;
}
/**
* {@inheritdoc}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment