Skip to content
Snippets Groups Projects
Commit b9d17992 authored by Jonathan Smith's avatar Jonathan Smith Committed by Jonathan Smith
Browse files

Issue #3049134 by jonathan1055, jklmnop: Publish/Unpublish fields do not have...

Issue #3049134 by jonathan1055, jklmnop: Publish/Unpublish fields do not have "is empty" and "is not empty" filter operators in views
parent 64570039
No related branches found
No related tags found
No related merge requests found
......@@ -385,6 +385,19 @@ function scheduler_entity_base_field_info(EntityTypeInterface $entity_type) {
}
}
/**
* Implements hook_views_data_alter().
*/
function scheduler_views_data_alter(array &$data) {
// By default the 'is null' and 'is not null' operators are only added to the
// list of filter options if the view contains a relationship. We want them to
// be always available for the scheduler date fields.
$data['node_field_data']['publish_on']['filter']['allow empty'] = TRUE;
$data['node_field_data']['unpublish_on']['filter']['allow empty'] = TRUE;
$data['node_field_revision']['publish_on']['filter']['allow empty'] = TRUE;
$data['node_field_revision']['unpublish_on']['filter']['allow empty'] = TRUE;
}
/**
* Implements hook_ENTITY_TYPE_view() for node entities.
*/
......
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