Commit e7336a44 authored by Marcin Grabias's avatar Marcin Grabias
Browse files

Issue #3248186: Keep supporting Drupal 8.

parent d83b999e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -212,7 +212,14 @@ class ViewsBulkOperationsActionManager extends ActionManager {
    $event = new Event();
    $event->alterParameters = $this->alterParameters;
    $event->definitions = &$definitions;

    // @todo: remove the conditional when Drupal 8 is no longer supported.
    if (floatval(\Drupal::VERSION) < 9) {
      $this->eventDispatcher->dispatch(static::ALTER_ACTIONS_EVENT, $event);
    }
    else {
      $this->eventDispatcher->dispatch($event, static::ALTER_ACTIONS_EVENT);
    }

    // Include the expected behaviour (hook system) to avoid security issues.
    parent::alterDefinitions($definitions);
+9 −1
Original line number Diff line number Diff line
@@ -91,7 +91,15 @@ class ViewsBulkOperationsViewData implements ViewsBulkOperationsViewDataInterfac

    // Get view entity types and results fetcher callable.
    $event = new ViewsBulkOperationsEvent($this->getViewProvider(), $this->getData(), $view);

    // @todo: remove the conditional when Drupal 8 is no longer supported.
    if (floatval(\Drupal::VERSION) < 9) {
      $this->eventDispatcher->dispatch(ViewsBulkOperationsEvent::NAME, $event);
    }
    else {
      $this->eventDispatcher->dispatch($event, ViewsBulkOperationsEvent::NAME);
    }

    $this->entityTypeIds = $event->getEntityTypeIds();
    $this->entityGetter = $event->getEntityGetter();
  }