Update Hook Event Dispatcher module

- Update the Hook Event Dispatcher module from `8.x-1.29` to `8.x-2.02`.
- Update custom modules after breaking changes from upgrading.

References #112
This commit is contained in:
Oliver Davies 2020-09-06 12:05:45 +01:00
parent 61442ed74c
commit 0f01551f26
8 changed files with 45 additions and 25 deletions

View file

@ -6,7 +6,7 @@ namespace Drupal\opdavies_blog\EventSubscriber;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\hook_event_dispatcher\Event\Entity\BaseEntityEvent;
use Drupal\core_event_dispatcher\Event\Entity\AbstractEntityEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\opdavies_blog\Entity\Node\Post;
use GuzzleHttp\Client;
@ -37,7 +37,7 @@ final class PushBlogPostToSocialMedia implements EventSubscriberInterface {
];
}
public function onEntityUpdate(BaseEntityEvent $event): void {
public function onEntityUpdate(AbstractEntityEvent $event): void {
$entity = $event->getEntity();
if ($entity->getEntityTypeId() != 'node') {

View file

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Drupal\opdavies_blog\EventSubscriber;
use Drupal\hook_event_dispatcher\Event\Entity\BaseEntityEvent;
use Drupal\core_event_dispatcher\Event\Entity\AbstractEntityEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\opdavies_blog\Entity\Node\Post;
use Drupal\taxonomy\TermInterface;
@ -21,7 +21,7 @@ final class ReorderBlogTags implements EventSubscriberInterface {
];
}
public function onEntityPresave(BaseEntityEvent $event): void {
public function onEntityPresave(AbstractEntityEvent $event): void {
$entity = $event->getEntity();
if ($entity->getEntityTypeId() != 'node') {

View file

@ -25,6 +25,7 @@ final class ReorderBlogTagsTest extends EntityKernelTestBase {
// Contrib.
'discoverable_entity_bundle_classes',
'hook_event_dispatcher',
'core_event_dispatcher',
// Custom.
'opdavies_blog_test',

View file

@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Drupal\opdavies_talks\EventSubscriber;
use Carbon\Carbon;
use Drupal\hook_event_dispatcher\Event\Entity\BaseEntityEvent;
use Drupal\core_event_dispatcher\Event\Entity\AbstractEntityEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\opdavies_talks\Entity\Node\Talk;
use Drupal\paragraphs\ParagraphInterface;
@ -22,7 +22,7 @@ final class UpdateTalkNodeBeforeSave implements EventSubscriberInterface {
];
}
public function onEntityPreSave(BaseEntityEvent $event): void {
public function onEntityPreSave(AbstractEntityEvent $event): void {
if ($event->getEntity()->getEntityTypeId() != 'node') {
return;
}

View file

@ -26,6 +26,7 @@ abstract class TalksTestBase extends EntityKernelTestBase {
'entity_reference_revisions',
'paragraphs',
'hook_event_dispatcher',
'core_event_dispatcher',
// Custom.
'opdavies_talks',