Problem/Motivation

Since upgrade to Core 8.8 removes the url_alias table (see https://www.drupal.org/project/drupal/releases/8.8.0), fast 404 needs to change the table it checks or you get a fatal error like this:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.url_alias' doesn't exist: SELECT pid FROM {url_alias} WHERE alias = :alias; Array ( [:alias] => /blog ) in Drupal\fast404\Fast404->pathCheck() (line 158 of modules/contrib/fast_404/src/Fast404.php).

Drupal\Core\Database\Statement->execute(Array, Array) (Line: 634)
Drupal\Core\Database\Connection->query('SELECT pid FROM {url_alias} WHERE alias = :alias', Array, Array) (Line: 357)
Drupal\Core\Database\Driver\mysql\Connection->query('SELECT pid FROM {url_alias} WHERE alias = :alias', Array) (Line: 158)

Because of this code:

    // Check the URL alias table for anything that's not a standard Drupal path.
    // Remove any trailing slash found in the request path.
    $path_noslash = rtrim($path, '/');
    $sql = "SELECT pid FROM {url_alias} WHERE alias = :alias";
    $result = Database::getConnection()->query($sql, [':alias' => $path_noslash])->fetchField();
    if ($result) {
      return;
    }

Proposed resolution

Update table being checked.

Remaining tasks

Patch coming shortly.

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Compatability with Drupal 8.8.

Marking as 'Critical' because it renders a site unusable and has no workaround.

Comments

scott_euser created an issue. See original summary.

scott_euser’s picture

Status: Active » Needs review
StatusFileSize
new881 bytes
new881 bytes

First patch applies to alpha 4, second patch applies to dev.

scott_euser’s picture

Assigned: scott_euser » Unassigned
amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

gg4’s picture

Status: Reviewed & tested by the community » Needs work

I think we will also need to add core_version_requirement: ^8.8 to fast404.info.yml and remove the current core and dependencies keys.

gg4’s picture

Status: Needs work » Needs review
StatusFileSize
new1.22 KB
akashkumar07’s picture

StatusFileSize
new1.32 KB

Please review the patch. Thanks

prempatel2447’s picture

StatusFileSize
new1.07 KB

Please review the patch. It will work for Drupal core version 8.8 and below 8.8 as well.

vatsalkhanna’s picture

Reviewed the patch provided on #9. It works great!
After applying patch this issue got resolved. Tested the patch on Drupal 8.8.1 and PHP 7.3.9

vatsalkhanna’s picture

Status: Needs review » Reviewed & tested by the community
gg4’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.36 KB

  • bonus committed a53a4f1 on 8.x-2.x
    Issue #3102050 by scott_euser, bonus: Base table not found after upgrade...
gg4’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Needs review » Fixed

Created a 8.x-2.x branch for Drupal ^8.8 and committed #12 (minor adjustments to #7).

gg4’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.