Verified Commit 15cebd32 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3231341 by Spokje, gaurav.kapoor, Wim Leers, xjm, catch: Deprecate...

Issue #3231341 by Spokje, gaurav.kapoor, Wim Leers, xjm, catch: Deprecate EditorLinkDialog, EditorImageDialog and EditorMediaDialog in Drupal 10.1 for removal in Drupal 11
parent d30d643a
Loading
Loading
Loading
Loading
+6 −0
Changes for core/.deprecation-ignore.txt: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,3 +21,9 @@
%"PHPUnit\\Framework\\TestListenerDefaultImplementation".*is deprecated%
%"PHPUnit\\Framework\\TestSuite".*is considered internal%
%"PHPUnit\\TextUI\\DefaultResultPrinter".*is considered internal%

# Skip deprecations for EditorMediaDialog, EditorImageDialog and EditorLinkDialog triggered by
# \Drupal\Core\Entity\EntityResolverManager::setRouteOptions().
%Drupal\\media\\Form\\EditorMediaDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493%
%Drupal\\editor\\Form\\EditorImageDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493%
%Drupal\\editor\\Form\\EditorLinkDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493%
+6 −0
Changes for core/modules/editor/src/Form/EditorImageDialog.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,11 @@
/**
 * Provides an image dialog for text editors.
 *
 * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no
 * replacement.
 *
 * @see https://www.drupal.org/project/drupal/issues/3291493
 *
 * @internal
 */
class EditorImageDialog extends FormBase {
@@ -35,6 +40,7 @@ class EditorImageDialog extends FormBase {
   *   The file storage service.
   */
  public function __construct(EntityStorageInterface $file_storage) {
    @trigger_error(__NAMESPACE__ . '\EditorImageDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493', E_USER_DEPRECATED);
    $this->fileStorage = $file_storage;
  }

+12 −0
Changes for core/modules/editor/src/Form/EditorLinkDialog.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,10 +13,22 @@
/**
 * Provides a link dialog for text editors.
 *
 * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no
 * replacement.
 *
 * @see https://www.drupal.org/project/drupal/issues/3291493
 *
 * @internal
 */
class EditorLinkDialog extends FormBase {

  /**
   * Constructs a form object for link dialog.
   */
  public function __construct() {
    @trigger_error(__NAMESPACE__ . '\EditorLinkDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493', E_USER_DEPRECATED);
  }

  /**
   * {@inheritdoc}
   */
+42 −0
Changes for core/modules/editor/tests/src/Kernel/EditorDeprecationTest.php: 42 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\editor\Kernel;

use Drupal\editor\Form\EditorImageDialog;
use Drupal\editor\Form\EditorLinkDialog;
use Drupal\KernelTests\KernelTestBase;

/**
 * Tests the deprecations in Drupal\editor.
 *
 * @group editor
 * @group legacy
 */
class EditorDeprecationTest extends KernelTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['editor'];

  /**
   * Tests the deprecation of the Drupal\editor\Form\EditorLinkDialog class.
   *
   * @see EditorLinkDialog
   */
  public function testEditorLinkDialog(): void {
    $this->expectDeprecation('Drupal\editor\Form\EditorLinkDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493');
    new EditorLinkDialog();
  }

  /**
   * Tests the deprecation of the Drupal\editor\Form\EditorImageDialog class.
   *
   * @see EditorImageDialog
   */
  public function testEditorImageDialog(): void {
    $this->expectDeprecation('Drupal\editor\Form\EditorImageDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493');
    new EditorImageDialog($this->createMock('\Drupal\file\FileStorage'));
  }

}
+1 −0
Changes for core/modules/editor/tests/src/Kernel/EditorImageDialogTest.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
 * Tests EditorImageDialog validation and conversion functionality.
 *
 * @group editor
 * @group legacy
 */
class EditorImageDialogTest extends EntityKernelTestBase {

Loading