Commit 889f57b0 authored by Marcin Grabias's avatar Marcin Grabias Committed by Marcin Grabias
Browse files

Issue #3261870 by heddn, Graber, victoria-marina: Handle Drupal 9 deprecations

parent 1f3fdb01
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
namespace Drupal\actions_permissions\EventSubscriber;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
use Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionManager;

/**
@@ -31,7 +31,7 @@ class ActionsPermissionsEventSubscriber implements EventSubscriberInterface {
  /**
   * Alter the actions' definitions.
   *
   * @var \Symfony\Component\EventDispatcher\Event $event
   * @var \Drupal\Component\EventDispatcher\Event $event
   *   The event to respond to.
   */
  public function alterActions(Event $event) {
+4 −10
Original line number Diff line number Diff line
@@ -2,13 +2,13 @@

namespace Drupal\views_bulk_operations\Service;

use Drupal\Component\EventDispatcher\Event;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Core\Action\ActionManager;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;

/**
 * Defines Views Bulk Operations action manager.
@@ -217,13 +217,7 @@ class ViewsBulkOperationsActionManager extends ActionManager {
    $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);
+1 −7
Original line number Diff line number Diff line
@@ -92,13 +92,7 @@ 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();
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

namespace Drupal\views_bulk_operations;

use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
use Drupal\views\ViewExecutable;

/**
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class DrushCommandsTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = [
  protected static $modules = [
    'node',
    'views',
    'views_bulk_operations',
@@ -34,7 +34,7 @@ class DrushCommandsTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();

    // Create some nodes for testing.
Loading