It would be nice if we could filter a query based on the "moderation state" field provided by the drupal core "content moderation" and "workflows" module.
Steps to reproduce:
1) Enable the drupal core "content_moderation" and "workflows" module. (i.e. drush en workflows drush en content_moderation)
2) Go to admin/config/workflow/workflows
3) select the "Editorial workflow"
4) create a custom state (in the example below i put "Quality Assurance") as a sample new state.
What I'd like and what is not possible right now is a way to filter by that field to do something like so:
EX:
$query = \Drupal::entityQuery('node')
->condition('type', 'page)
->condition('field_moderation_state', 'quality_assurance');
$result = $query->execute();
The entity api is awesome and I can filter by any other custom field I make, But that "moderation_state" field can't be filtered. I've tried it by using both ->condition('field_moderation_state', 'quality_assurance'); and ->condition('moderation_state', 'quality_assurance');
Comments
Comment #2
bojanz commentedMoving to core. The Entity API module is a not a factor here.