Skip to content
Snippets Groups Projects
Verified Commit 5d36ca0c authored by Luhur Abdi Rizal's avatar Luhur Abdi Rizal Committed by Luhur Abdi Rizal
Browse files

Issue #3281066 by el7cosmos: Require minimum Drupal core 9.3

parent 754299f6
No related branches found
Tags 7.x-1.0-beta3
No related merge requests found
Description
-----------
This module dispatches events for several drupal core hooks. This allows you to
use the D8 Event Subscriber system instead of the outdated hook system to react
use the Drupal Event Subscriber system instead of the outdated hook system to react
on certain events. The module includes events for the most common hooks.
If you want to see new events registered, open an issue in the issue queue and
we will try to add it. Hopefully, in the near future, D8 core will put this
we will try to add it. Hopefully, in the near future, Drupal core will put this
into core.
Installation
......@@ -22,23 +22,3 @@ Manual installation:
Examples
--------
You can find an example on how to use each Event in src/Example
Upgrading from 1.x to 2.x
------------------------
The 2.x version has been refactored to include several submodules that will
need to be enabled in addition to the main hook_event_dispatcher modules, in
order to use the events they expose. These currently include:
- core_event_dispatcher
- field_event_dispatcher
- media_event_dispatcher
- path_event_dispatcher
- preprocess_event_dispatcher
- toolbar_event_dispatcher
- user_event_dispatcher
- views_event_dispatcher
- webform_event_dispatcher
For example, for Core hooks like THEME, the submodule of
'core_event_dispatcher' has to be enabled for the site to continue working
properly and the namespace of the used event will need to be updated.
......@@ -9,7 +9,7 @@
"source": "https://git.drupalcode.org/project/hook_event_dispatcher"
},
"require": {
"drupal/core": "^9.2"
"drupal/core": "^9.3"
},
"require-dev": {
"drupal/eck": "^1.0@alpha",
......
name: Hook Event Dispatcher
type: module
description: Dispatches events for several drupal hooks
core_version_requirement: ^9.1
core_version_requirement: ^9.3
package: Hook events
......@@ -12,7 +12,9 @@
*/
function hook_event_dispatcher_help(string $routeName) {
if ($routeName === 'help.page.hook_event_dispatcher') {
$path = drupal_get_path('module', 'hook_event_dispatcher');
/** @var \Drupal\Core\Extension\ExtensionPathResolver $resolver */
$resolver = \Drupal::service('extension.path.resolver');
$path = $resolver->getPath('module', 'hook_event_dispatcher');
$output = file_get_contents($path . '/README.md');
return '<pre>' . $output . '</pre>';
}
......
......@@ -32,9 +32,7 @@ class FileUrlAlterEventTest extends KernelTestBase {
];
/**
* Test FileUrlAlterEvent for drupal core >= 9.3.x.
*
* @requires function \Drupal\Core\File\FileUrlGenerator::generateAbsoluteString
* Test FileUrlAlterEvent.
*
* @throws \Exception
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment