Skip to content
Snippets Groups Projects
Commit 3d16375e authored by Owen Bush's avatar Owen Bush
Browse files

Computed fields cannot be sorts or filters

parent e613b25f
No related branches found
No related tags found
No related merge requests found
......@@ -38,18 +38,6 @@ function recurring_events_views_data_alter(array &$data) {
'id' => 'eventinstance_title',
'field_name' => 'title',
],
'filter' => [
'title' => t('Event instance title'),
'help' => t('The inherited title of an event instance.'),
'id' => 'eventinstance_title',
'field_name' => 'title',
],
'sort' => [
'title' => t('Event instance title'),
'help' => t('The inherited title of an event instance.'),
'id' => 'eventinstance_title',
'field_name' => 'title',
],
];
// Create a field to show the inherited description of an event instance.
......@@ -61,17 +49,5 @@ function recurring_events_views_data_alter(array &$data) {
'id' => 'eventinstance_description',
'field_name' => 'description',
],
'filter' => [
'title' => t('Event instance description'),
'help' => t('The inherited description of an event instance.'),
'id' => 'eventinstance_description',
'field_name' => 'description',
],
'sort' => [
'title' => t('Event instance description'),
'help' => t('The inherited description of an event instance.'),
'id' => 'eventinstance_description',
'field_name' => 'description',
],
];
}
<?php
namespace Drupal\recurring_events\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\StringFilter;
/**
* Filter handler for the inherited event instance description.
*
* @ingroup views_filter_handlers
*
* @ViewsFilter("eventinstance_description")
*/
class EventInstanceDescription extends StringFilter {
}
<?php
namespace Drupal\recurring_events\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\StringFilter;
/**
* Filter handler for the inherited event instance title.
*
* @ingroup views_filter_handlers
*
* @ViewsFilter("eventinstance_title")
*/
class EventInstanceTitle extends StringFilter {
}
<?php
namespace Drupal\recurring_events\Plugin\views\sort;
use Drupal\views\Plugin\views\sort\Standard;
/**
* Sort handler for the inherited event instance description.
*
* @ingroup views_filter_handlers
*
* @ViewsSort("eventinstance_description")
*/
class EventInstanceDescription extends Standard {
}
<?php
namespace Drupal\recurring_events\Plugin\views\sort;
use Drupal\views\Plugin\views\sort\Standard;
/**
* Sort handler for the inherited event instance title.
*
* @ingroup views_filter_handlers
*
* @ViewsSort("eventinstance_title")
*/
class EventInstanceTitle extends Standard {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment