Commit b5ae1de2 authored by Dieter Holvoet's avatar Dieter Holvoet Committed by Pravin Gaikwad
Browse files

Issue #3287213 by deepakkm, Project Update Bot, DieterHolvoet, vipin.mittal18,...

Issue #3287213 by deepakkm, Project Update Bot, DieterHolvoet, vipin.mittal18, Rajeshreeputra, chandu7929, ankitv18: Automated Drupal 10 compatibility fixes
parent 0523f69a
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
<?php

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\entity_clone\Event\EntityCloneEvent;
use Drupal\entity_clone\Event\EntityCloneEvents;
/**
 * @file
 * Entity Clone hooks and events.
 */

/**
 * Event subscribers for Entity Clone.
 *
@@ -25,7 +27,7 @@
 * ?>
 * </code>
 */
class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface {
class MyEntityCloneEventSubscriber implements EventSubscriberInterface {

  /**
   * An example event subscriber.
@@ -34,7 +36,7 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher
   *
   * @see \Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE
   */
  public function myPreClone(\Drupal\entity_clone\Event\EntityCloneEvent $event): void {
  public function myPreClone(EntityCloneEvent $event): void {
    $original = $event->getEntity();
    $newEntity = $event->getClonedEntity();
  }
@@ -46,7 +48,7 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher
   *
   * @see \Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE
   */
  public function myPostClone(\Drupal\entity_clone\Event\EntityCloneEvent $event): void {
  public function myPostClone(EntityCloneEvent $event): void {
    $original = $event->getEntity();
    $newEntity = $event->getClonedEntity();
  }
@@ -55,8 +57,8 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher
   * {@inheritdoc}
   */
  public static function getSubscribedEvents(): array {
    $events[\Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE][] = ['myPreClone'];
    $events[\Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE][] = ['myPostClone'];
    $events[EntityCloneEvents::PRE_CLONE][] = ['myPreClone'];
    $events[EntityCloneEvents::POST_CLONE][] = ['myPostClone'];
    return $events;
  }

+1 −2
Original line number Diff line number Diff line
name: Entity Clone
description: Add a clone action for all entities
core:  "8.x"
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
type: module
configure: entity_clone.settings
test_dependencies:
+2 −2
Original line number Diff line number Diff line
@@ -7,15 +7,16 @@

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Config\Entity\ConfigEntityTypeInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneBase;
use Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase;
use Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone;
use Drupal\entity_clone\EntityClone\Config\FieldConfigEntityClone;
use Drupal\entity_clone\EntityClone\Config\LayoutBuilderEntityClone;
use Drupal\entity_clone\EntityClone\Config\MenuEntityClone;
use Drupal\entity_clone\EntityClone\Config\MenuEntityCloneForm;
use Drupal\entity_clone\EntityClone\Content\ContentEntityCloneBase;
@@ -23,7 +24,6 @@ use Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase;
use Drupal\entity_clone\EntityClone\Content\FileEntityClone;
use Drupal\entity_clone\EntityClone\Content\TaxonomyTermEntityClone;
use Drupal\entity_clone\EntityClone\Content\UserEntityClone;
use Drupal\entity_clone\EntityClone\Config\LayoutBuilderEntityClone;

/**
 * Implements hook_help().
+1 −1
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ use Drupal\Component\Uuid\UuidInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\layout_builder\SectionComponent;
use Drupal\layout_builder\Section;
use Drupal\layout_builder\SectionComponent;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
+1 −1
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\TranslatableInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldConfigInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\entity_clone\EntityClone\EntityCloneInterface;
Loading