Commit 29131230 authored by Sascha Grossenbacher's avatar Sascha Grossenbacher
Browse files

Issue #3051124 by gmangones, karan_mudi, Berdir, sinn, DieterHolvoet,...

Issue #3051124 by gmangones, karan_mudi, Berdir, sinn, DieterHolvoet, SivaprasadC, arunkumark: Remove Drupal 8.7 and earlier deprecations, compatibility with Drupal 9
parent 67f6f77c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,6 +5,6 @@
  "license": "GPL-2.0+",
  "minimum-stability": "dev",
  "require": {
    "drupal/core": "~8"
      "drupal/core": "^8.7.7 || ^9"
  }
}
+1 −1
Original line number Diff line number Diff line
name: 'Redirect 404'
type: module
description: 'Logs 404 errors and allows users to create redirects for often requested but missing pages.'
core: 8.x
core_version_requirement: ^8.7.7 || ^9
configure: redirect_404.fix_404

dependencies:
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class SqlRedirectNotFoundStorage implements RedirectNotFoundStorageInterface {
      ->expression('count', 'count + 1')
      ->expression('daily_count', 'daily_count + 1')
      ->fields([
        'timestamp' => REQUEST_TIME,
        'timestamp' => \Drupal::time()->getRequestTime(),
        'count' => 1,
        'daily_count' => 1,
        'resolved' => 0,
+6 −4
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

namespace Drupal\Tests\redirect_404\Functional;

use Drupal\Core\Database\Database;

/**
 * Tests suppressing 404 logs if the suppress_404 setting is enabled.
 *
@@ -56,8 +58,8 @@ class Redirect404LogSuppressorTest extends Redirect404TestBase {
    $this->assertResponse(403);

    // Assert the events are logged in the dblog reports.
    $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1);
    $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 1);
    $this->assertEqual(Database::getConnection()->query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1);
    $this->assertEqual(Database::getConnection()->query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 1);

    // Login as admin and enable suppress_404 to avoid logging the 404 event.
    $this->drupalLogin($this->adminUser);
@@ -73,8 +75,8 @@ class Redirect404LogSuppressorTest extends Redirect404TestBase {

    // Assert only the new access denied event is logged now.
    $this->drupalLogin($this->adminUser);
    $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1);
    $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 2);
    $this->assertEqual(Database::getConnection()->query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1);
    $this->assertEqual(Database::getConnection()->query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 2);

  }
}
+5 −0
Original line number Diff line number Diff line
@@ -21,6 +21,11 @@ abstract class Redirect404TestBase extends BrowserTestBase {
    'path',
  ];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Permissions for the admin user.
   *
Loading