Commit 588c61a7 authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3273435: Error: Call to a member function getExecutable() on null in...

Issue #3273435: Error: Call to a member function getExecutable() on null in moderation_dashboard_toolbar_alter()
parent a30b591a
Loading
Loading
Loading
Loading
+21 −20
Original line number Diff line number Diff line
@@ -65,8 +65,9 @@ function moderation_dashboard_toolbar_alter(&$items) {
  if (isset($items['user']) && $user->hasPermission('use moderation dashboard')) {
    $view = \Drupal::service('entity_type.manager')
      ->getStorage('view')
      ->load('moderation_dashboard')
      ->getExecutable();
      ->load('moderation_dashboard');
    if ($view) {
      $view = $view->getExecutable();
      $view->setDisplay('page_1');
      $items['user']['tray']['moderation_dashboard'] = [
        '#theme' => 'links__toolbar_user',
@@ -87,7 +88,7 @@ function moderation_dashboard_toolbar_alter(&$items) {
        ],
      ];
    }

  }
  return $items;
}