Commit f6c2d706 authored by Sascha Grossenbacher's avatar Sascha Grossenbacher Committed by Sascha Grossenbacher
Browse files

Issue #3290252 by Project Update Bot, Berdir, taniachque, sharayurajput,...

Issue #3290252 by Project Update Bot, Berdir, taniachque, sharayurajput, reenaraghavan: Automated Drupal 10 compatibility fixes
parent 30311146
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -9,7 +9,11 @@
  },
  "license": "GPL-2.0+",
  "require": {
    "drupal/core": "^9 || ^10",
    "embed/embed": "^4.4",
    "drupal/embed": "^1.4"
  },
  "require-dev": {
    "drupal/ckeditor": "^1"
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ class DrupalUrl extends EmbedCKEditorPluginBase {
   * {@inheritdoc}
   */
  public function getFile() {
    return drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/plugin.js';
    return \Drupal::service('extension.list.module')->getPath('url_embed') . '/js/plugins/drupalurl/plugin.js';
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -23,6 +23,6 @@ class Url extends EmbedTypeBase {
   * {@inheritdoc}
   */
  public function getDefaultIconUrl() {
    return file_create_url(drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/urlembed.png');
    return \Drupal::service('file_url_generator')->generateAbsoluteString(\Drupal::service('extension.list.module')->getPath('url_embed') . '/js/plugins/drupalurl/urlembed.png');
  }
}
+4 −4
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class ConvertUrlToEmbedFilterTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['url_embed', 'node', 'ckeditor'];
  protected static $modules = ['url_embed', 'node', 'ckeditor'];

  /**
   * {@inheritdoc}
@@ -28,7 +28,7 @@ class ConvertUrlToEmbedFilterTest extends BrowserTestBase {
  /**
   * Set the configuration up.
   */
  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();
    // Create a page content type.
    $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
@@ -87,7 +87,7 @@ class ConvertUrlToEmbedFilterTest extends BrowserTestBase {
    $node = $this->drupalCreateNode($settings);
    $this->drupalGet('node/' . $node->id());
    $this->assertSession()->responseContains('<drupal-url data-embed-url="https://twitter.com/drupal/status/735873777683320832"></drupal-url>');
    $this->assertNoText(strip_tags($content), 'URL does not appear in the output when embed is successful.');
    $this->assertSession()->pageTextNotContains(strip_tags($content));

    $content = 'before /not-valid/url after';
    $settings = [];
@@ -123,7 +123,7 @@ class ConvertUrlToEmbedFilterTest extends BrowserTestBase {
    $node = $this->drupalCreateNode($settings);
    $this->drupalGet('node/' . $node->id());
    $this->assertSession()->responseContains('<drupal-url data-embed-url="https://twitter.com/drupal/status/735873777683320832"></drupal-url>');
    $this->assertNoText(strip_tags($content), 'URL does not appear in the output when embed is successful.');
    $this->assertSession()->pageTextNotContains(strip_tags($content));

    $content = 'before Embed https://twitter.com/drupal/status/735873777683320832 after';
    $settings = [];
+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ class LinkEmbedFormatterTest extends BrowserTestBase {
   *
   * @var array
   */
  public static $modules = ['url_embed', 'entity_test', 'link'];
  protected static $modules = ['url_embed', 'entity_test', 'link'];

  /**
   * {@inheritdoc}
@@ -101,7 +101,6 @@ class LinkEmbedFormatterTest extends BrowserTestBase {
    $content = $display->build($entity);
    $output = \Drupal::service('renderer')->renderRoot($content);
    $output = (string) $output;
    $this->verbose($output);
    return $output;
  }

Loading