diff --git a/src/Form/FacetDisplayForm.php b/src/Form/FacetDisplayForm.php index 0b42098..3cd08e5 100644 --- a/src/Form/FacetDisplayForm.php +++ b/src/Form/FacetDisplayForm.php @@ -51,7 +51,7 @@ class FacetDisplayForm extends EntityForm { /** * The plugin manager for sort processors. * - * @var \Drupal\facets\Widget\WidgetPluginManager + * @var \Drupal\facets\SortProcessor\SortProcessorPluginManager */ protected $sortProcessorPluginManager; @@ -543,7 +543,7 @@ class FacetDisplayForm extends EntityForm { // The sort processor handler should have the settings for all sorting // facets. if ($processor_id === 'sort_processor_handler') { - $new_settings['settings'] = $values['facet_sorting']; + $new_settings['settings'] = isset($values['facet_sorting']) ? $values['facet_sorting'] : []; } $facet->addProcessor($new_settings); } diff --git a/src/Plugin/facets/sort_processor/ActiveWidgetOrderProcessor.php b/src/Plugin/facets/sort_processor/ActiveWidgetOrderProcessor.php index e81ab36..f18cc84 100644 --- a/src/Plugin/facets/sort_processor/ActiveWidgetOrderProcessor.php +++ b/src/Plugin/facets/sort_processor/ActiveWidgetOrderProcessor.php @@ -11,10 +11,7 @@ use Drupal\facets\SortProcessor\SortProcessorPluginBase; * @FacetsSortProcessor( * id = "active_widget_order", * label = @Translation("Sort by active state"), - * description = @Translation("Sorts the widget results by active state."), - * stages = { - * "build" = 50 - * } + * description = @Translation("Sorts the widget results by active state.") * ) */ class ActiveWidgetOrderProcessor extends SortProcessorPluginBase { diff --git a/src/Plugin/facets/sort_processor/CountWidgetOrderProcessor.php b/src/Plugin/facets/sort_processor/CountWidgetOrderProcessor.php index 7484f94..87d95a2 100644 --- a/src/Plugin/facets/sort_processor/CountWidgetOrderProcessor.php +++ b/src/Plugin/facets/sort_processor/CountWidgetOrderProcessor.php @@ -11,10 +11,7 @@ use Drupal\facets\SortProcessor\SortProcessorPluginBase; * @FacetsSortProcessor( * id = "count_widget_order", * label = @Translation("Sort by count"), - * description = @Translation("Sorts the widget results by count."), - * stages = { - * "build" = 50 - * } + * description = @Translation("Sorts the widget results by count.") * ) */ class CountWidgetOrderProcessor extends SortProcessorPluginBase { diff --git a/src/Plugin/facets/sort_processor/DisplayValueWidgetOrderProcessor.php b/src/Plugin/facets/sort_processor/DisplayValueWidgetOrderProcessor.php index 3e1d090..9e1c1d3 100644 --- a/src/Plugin/facets/sort_processor/DisplayValueWidgetOrderProcessor.php +++ b/src/Plugin/facets/sort_processor/DisplayValueWidgetOrderProcessor.php @@ -3,6 +3,7 @@ namespace Drupal\facets\Plugin\facets\sort_processor; use Drupal\Component\Transliteration\TransliterationInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\facets\Result\Result; use Drupal\facets\SortProcessor\SortProcessorPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -13,13 +14,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * @FacetsSortProcessor( * id = "display_value_widget_order", * label = @Translation("Sort by display value"), - * description = @Translation("Sorts the widget results by display value."), - * stages = { - * "build" = 50 - * } + * description = @Translation("Sorts the widget results by display value.") * ) */ -class DisplayValueWidgetOrderProcessor extends SortProcessorPluginBase { +class DisplayValueWidgetOrderProcessor extends SortProcessorPluginBase implements ContainerFactoryPluginInterface { /** * The transliteration service. diff --git a/src/Plugin/facets/sort_processor/RawValueWidgetOrderProcessor.php b/src/Plugin/facets/sort_processor/RawValueWidgetOrderProcessor.php index 11fb0cb..d627300 100644 --- a/src/Plugin/facets/sort_processor/RawValueWidgetOrderProcessor.php +++ b/src/Plugin/facets/sort_processor/RawValueWidgetOrderProcessor.php @@ -11,10 +11,7 @@ use Drupal\facets\SortProcessor\SortProcessorPluginBase; * @FacetsSortProcessor( * id = "raw_value_widget_order", * label = @Translation("Sort by raw value"), - * description = @Translation("Sorts the widget results by raw value."), - * stages = { - * "build" = 50 - * } + * description = @Translation("Sorts the widget results by raw value.") * ) */ class RawValueWidgetOrderProcessor extends SortProcessorPluginBase { diff --git a/src/SortProcessor/SortProcessorPluginManager.php b/src/SortProcessor/SortProcessorPluginManager.php index 5ac0efd..e910389 100644 --- a/src/SortProcessor/SortProcessorPluginManager.php +++ b/src/SortProcessor/SortProcessorPluginManager.php @@ -7,7 +7,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\DefaultPluginManager; /** - * Manages URL processor plugins. + * Manages sort processor plugins. * * @see \Drupal\facets\Annotation\FacetsProcessor * @see \Drupal\facets\Processor\ProcessorInterface