[Drupal 10.3] Fatal error: Schema::tableExists($table) must be compatible

Created on 24 June 2024, 10 days ago
Updated 4 July 2024, about 12 hours ago

Problem/Motivation

I get a fatal error (for entire website) upon updating to Drupal 10.3

Fatal error: Declaration of Drupal\sqlsrv\Driver\Database\sqlsrv\Schema::tableExists($table) must be compatible with Drupal\Core\Database\Schema::tableExists($table, bool $add_prefix = true) in /var/www/html/web/modules/contrib/sqlsrv/src/Driver/Database/sqlsrv/Schema.php on line 863

Steps to reproduce

Use the module with Drupal 10.3

Proposed resolution

Add the missing function parameter in a backwards-compatible way. Since the new parameter provides a default value, this will work, and it works in existing pre-10.3 versions, too:

  public function tableExists($table, bool $add_prefix = TRUE) {
    if (empty($table)) {
      return FALSE;
    }
    // Temporary tables and regular tables cannot be verified in the same way.
    $query = NULL;
    $prefixInfo = $this->getPrefixInfo($table, $add_prefix);
    ...

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

RTBC

Version

4.4

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024