Commit 9b46abdb authored by Luhur Abdi Rizal's avatar Luhur Abdi Rizal
Browse files

Issue #3277301 by el7cosmos, dpi: Adapt to centralised hook dispatcher in Drupal 9.4

parent 0419aaff
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
        "drupal/core": "^9.3"
    },
    "require-dev": {
        "drupal/coder": "<=8.3.13",
        "drupal/eck": "^1.0@alpha",
        "drupal/paragraphs": "^1.10",
        "drupal/webform": "^6.0",
+13 −0
Original line number Diff line number Diff line
@@ -3,3 +3,16 @@ services:
    class: Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManager
    arguments:
      - '@event_dispatcher'

  hook_event_dispatcher.module_handler:
    decorates: module_handler
    class: Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler
    arguments:
      - '@hook_event_dispatcher.module_handler.inner'
      - '@hook_event_dispatcher.manager'
      - '@plugin.manager.hook_event'

  plugin.manager.hook_event:
    class: Drupal\hook_event_dispatcher\HookEventPluginManager
    parent: default_plugin_manager
    lazy: true
+1 −1
Original line number Diff line number Diff line
name: Core Event Dispatcher
type: module
description: Registers event dispatchers for several core hooks
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.4
package: Hook events
dependencies:
  - hook_event_dispatcher:hook_event_dispatcher
+0 −752

File changed.

Preview size limit exceeded, changes collapsed.

+14 −1
Original line number Diff line number Diff line
@@ -10,11 +10,17 @@ use Drupal\core_event_dispatcher\BlockHookEvents;
use Drupal\hook_event_dispatcher\Event\AccessEventInterface;
use Drupal\hook_event_dispatcher\Event\AccessEventTrait;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\Event\HookReturnInterface;

/**
 * Class BlockAccessEvent.
 *
 * @HookEvent(
 *   id = "block_access",
 *   hook = "block_access"
 * )
 */
class BlockAccessEvent extends Event implements EventInterface, AccessEventInterface {
class BlockAccessEvent extends Event implements EventInterface, AccessEventInterface, HookReturnInterface {

  use AccessEventTrait;

@@ -52,4 +58,11 @@ class BlockAccessEvent extends Event implements EventInterface, AccessEventInter
    return BlockHookEvents::BLOCK_ACCESS;
  }

  /**
   * {@inheritdoc}
   */
  public function getReturnValue() {
    return $this->getAccessResult();
  }

}
Loading