Commit 0ab5914c authored by john.oltman's avatar john.oltman Committed by john.oltman
Browse files

Issue #3287677: Drupal 10 compatibility fixes.

parent e415c1fd
Loading
Loading
Loading
Loading
+1 −1
Changes for composer.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -14,6 +14,6 @@
  "license": "GPL-2.0+",
  "minimum-stability": "dev",
  "require": {
    "drupal/core": "^8.8 || ^9"
    "drupal/core": "^8.8 || ^9 || ^10"
  }
}
+1 −1
Changes for forward.info.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ name: Forward
type: module
description: 'Forward pages to a friend.'
package: Fields
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^8.8 || ^9 || ^10
configure: forward.settings
dependencies:
  - drupal:field
+1 −1
Changes for src/Services/ForwardLinkGenerator.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ class ForwardLinkGenerator implements ForwardLinkGeneratorInterface {

    $html = FALSE;
    // Output the correct style of link.
    $default_icon = drupal_get_path('module', 'forward') . '/images/forward.gif';
    $default_icon = \Drupal::service('extension.list.module')->getPath('forward') . '/images/forward.gif';
    $custom_icon = $settings['icon'];
    $link_style = $settings['style'];
    switch ($link_style) {
+12 −12
Changes for tests/src/Functional/ForwardFormTest.php: 12 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@ class ForwardFormTest extends ForwardTestBase {
    $article = $this->drupalCreateNode(['type' => 'article']);
    $this->drupalLogin($this->forwardUser);
    $this->drupalGet('node/' . $article->id());
    $this->assertText('Forward this article to a friend', 'The article has a Forward link.');
    $this->assertSession()->pageTextContains('Forward this article to a friend');
    $this->drupalGet('/forward/node/' . $article->id());
    $this->assertText('Forward this article to a friend', 'The Forward form displays for an article.');
    $this->assertSession()->pageTextContains('Forward this article to a friend');

    // Submit the Forward form.
    $edit = [
@@ -27,8 +27,8 @@ class ForwardFormTest extends ForwardTestBase {
      'recipient' => 'test@test.com',
      'message' => 'This is a test personal message.',
    ];
    $this->drupalPostForm(NULL, $edit, 'Send Message');
    $this->assertText('Thank you for spreading the word about Drupal.', 'The Forward form displays a thank you message after submit.');
    $this->submitForm($edit, 'Send Message');
    $this->assertSession()->pageTextContains('Thank you for spreading the word about Drupal.');

    // Submit the Forward form without a recipient.
    $this->drupalGet('/forward/node/' . $article->id());
@@ -36,8 +36,8 @@ class ForwardFormTest extends ForwardTestBase {
      'name' => 'Test Forwarder',
      'message' => 'This is a test personal message.',
    ];
    $this->drupalPostForm(NULL, $edit, 'Send Message');
    $this->assertText('Send to field is required.', 'The Forward form displays an error message when the recipient is blank.');
    $this->submitForm($edit, 'Send Message');
    $this->assertSession()->pageTextContains('Send to field is required.');

    // Submit the Forward form without a personal message when required.
    $this->drupalLogin($this->adminUser);
@@ -45,15 +45,15 @@ class ForwardFormTest extends ForwardTestBase {
    $edit = [
      'forward_personal_message' => 2,
    ];
    $this->drupalPostForm(NULL, $edit, 'Save configuration');
    $this->submitForm($edit, 'Save configuration');
    $this->drupalLogin($this->forwardUser);
    $this->drupalGet('/forward/node/' . $article->id());
    $edit = [
      'name' => 'Test Forwarder',
      'recipient' => 'test@test.com',
    ];
    $this->drupalPostForm(NULL, $edit, 'Send Message');
    $this->assertText('Your personal message field is required.', 'The Forward form displays an error message when the message is blank and one is required.');
    $this->submitForm($edit, 'Send Message');
    $this->assertSession()->pageTextContains('Your personal message field is required.');

    // Submit the Forward form without a personal message when optional.
    $this->drupalLogin($this->adminUser);
@@ -61,15 +61,15 @@ class ForwardFormTest extends ForwardTestBase {
    $edit = [
      'forward_personal_message' => 1,
    ];
    $this->drupalPostForm(NULL, $edit, 'Save configuration');
    $this->submitForm($edit, 'Save configuration');
    $this->drupalLogin($this->forwardUser);
    $this->drupalGet('/forward/node/' . $article->id());
    $edit = [
      'name' => 'Test Forwarder',
      'recipient' => 'test@test.com',
    ];
    $this->drupalPostForm(NULL, $edit, 'Send Message');
    $this->assertNoText('Your personal message field is required.', 'The Forward form does not display an error message when the message is blank and optional.');
    $this->submitForm($edit, 'Send Message');
    $this->assertSession()->pageTextNotContains('Your personal message field is required.');
  }

}
+1 −1
Changes for tests/src/Functional/ForwardTestBase.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ abstract class ForwardTestBase extends BrowserTestBase {
  /**
   * Perform any initial set up tasks that run before every test method.
   */
  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();

    // Create Basic page and Article node types.
Loading