Loading modules/redirect_404/redirect_404.module +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,10 @@ function redirect_404_form_redirect_settings_form_alter(&$form, FormStateInterfa $ignored_pages .= $path_to_ignore; } // Replace '\r\n' with '\n' to keep consistency in tests. // See: https://www.drupal.org/project/redirect/issues/3244924 $ignored_pages = str_replace("\r\n", "\n", $ignored_pages); $form['ignore_pages'] = [ '#type' => 'textarea', '#title' => t('Pages to ignore'), Loading modules/redirect_404/tests/src/Functional/Fix404RedirectUITest.php +3 −3 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ class Fix404RedirectUITest extends Redirect404TestBase { $this->clickLink('Ignore'); $this->assertUrl('admin/config/search/redirect/settings?ignore=' . $path_to_ignore . $destination); $this->assertText('Resolved the path ' . $path_to_ignore . ' in the database. Please check the ignored list and save the settings.'); $this->assertSession()->fieldValueEquals('ignore_pages', $node_to_ignore . "\r\n/term/*\n/node/2/test"); $this->assertSession()->fieldValueEquals('ignore_pages', $node_to_ignore . "\n/term/*\n/node/2/test"); $this->assertSession()->elementContains('css', '#edit-ignore-pages', $node_to_ignore); $this->assertSession()->elementContains('css', '#edit-ignore-pages', $terms_to_ignore); $this->assertSession()->elementContains('css', '#edit-ignore-pages', $path_to_ignore); Loading Loading @@ -187,10 +187,10 @@ class Fix404RedirectUITest extends Redirect404TestBase { $this->drupalGet('admin/config/search/redirect/404'); $this->assertText('llama_page'); $this->clickLink('Ignore'); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\r\n/term/*\n/llama_page"); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\n/term/*\n/llama_page"); $this->getSession()->getPage()->pressButton('Save configuration'); $this->drupalGet('admin/config/search/redirect/settings'); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\r\n/term/*\n/llama_page"); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\n/term/*\n/llama_page"); } /** Loading Loading
modules/redirect_404/redirect_404.module +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,10 @@ function redirect_404_form_redirect_settings_form_alter(&$form, FormStateInterfa $ignored_pages .= $path_to_ignore; } // Replace '\r\n' with '\n' to keep consistency in tests. // See: https://www.drupal.org/project/redirect/issues/3244924 $ignored_pages = str_replace("\r\n", "\n", $ignored_pages); $form['ignore_pages'] = [ '#type' => 'textarea', '#title' => t('Pages to ignore'), Loading
modules/redirect_404/tests/src/Functional/Fix404RedirectUITest.php +3 −3 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ class Fix404RedirectUITest extends Redirect404TestBase { $this->clickLink('Ignore'); $this->assertUrl('admin/config/search/redirect/settings?ignore=' . $path_to_ignore . $destination); $this->assertText('Resolved the path ' . $path_to_ignore . ' in the database. Please check the ignored list and save the settings.'); $this->assertSession()->fieldValueEquals('ignore_pages', $node_to_ignore . "\r\n/term/*\n/node/2/test"); $this->assertSession()->fieldValueEquals('ignore_pages', $node_to_ignore . "\n/term/*\n/node/2/test"); $this->assertSession()->elementContains('css', '#edit-ignore-pages', $node_to_ignore); $this->assertSession()->elementContains('css', '#edit-ignore-pages', $terms_to_ignore); $this->assertSession()->elementContains('css', '#edit-ignore-pages', $path_to_ignore); Loading Loading @@ -187,10 +187,10 @@ class Fix404RedirectUITest extends Redirect404TestBase { $this->drupalGet('admin/config/search/redirect/404'); $this->assertText('llama_page'); $this->clickLink('Ignore'); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\r\n/term/*\n/llama_page"); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\n/term/*\n/llama_page"); $this->getSession()->getPage()->pressButton('Save configuration'); $this->drupalGet('admin/config/search/redirect/settings'); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\r\n/term/*\n/llama_page"); $this->assertSession()->fieldValueEquals('ignore_pages', "/node/*\n/term/*\n/llama_page"); } /** Loading