You are here

function content_moderation_views_post_execute in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/content_moderation.module \content_moderation_views_post_execute()
  2. 10 core/modules/content_moderation/content_moderation.module \content_moderation_views_post_execute()

Implements hook_views_post_execute().

File

core/modules/content_moderation/content_moderation.module, line 436
Contains content_moderation.module.

Code

function content_moderation_views_post_execute(ViewExecutable $view) {

  // @todo, remove this once broken handlers in views configuration result in
  // a view no longer returning results. https://www.drupal.org/node/2907954.
  foreach ($view->filter as $id => $filter) {
    if (strpos($id, 'moderation_state') === 0 && $filter instanceof Broken) {
      $view->result = [];
      break;
    }
  }
}