Drupal 10 compatability

Created on 26 April 2023, about 1 year ago
Updated 8 November 2023, 8 months ago

Problem/Motivation

This issue is for tracking and coordinating all work needed to get achieve a Drupal 10 release. The main blockers outstanding are:

It also looks like there's a couple of other non-D10 specific open issues that should be resolved before making a new release ( 3263493 πŸ› Upgrading to Drupal 9.3.x changes users table and locks users out of the site Needs work , 3259467 πŸ› Service not found exception Fixed )

Proposed resolution

Address outstanding issues and make new D10 compatible release.

πŸ“Œ Task
Status

Active

Version

4.4

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom pstewart

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

Comments & Activities

  • Issue created by @pstewart
  • πŸ‡¬πŸ‡§United Kingdom pstewart

    It looks like a new branch will be necessary as we'll need to use the new Drupal\Core\Database\SupportsTemporaryTablesInterface interface which is not available in D9.5. See 3246056#6 πŸ› deprecation notices in 4.3.x Needs work .

    My suggestion is that we start a new 5.x series for D10 and beyond, with 4.3.x continuing for D9 support until D9.5 eol.

  • πŸ‡ΈπŸ‡ͺSweden arne_hortell

    Im trying out ODBC now and from ubuntu cli its possible to connect to database but fron drupal it doesnt work.
    /opt/mssql-tools18/bin/sqlcmd -S DSNNAME -D -U theUserName -PpAssW0rd

    Any idea how to get D10 to install in this?

    $databases = array (
    'default' =>
    array (
    'default' =>
    array (
    'database' => $database,
    'username' => $username,
    'password' => $password,
    'host' => $host,
    'port' => 1433,
    'driver' => 'odbc',
    'odbc_driver' => 'ODBC Driver 18 for SQL Server',
    ),
    ),
    );

    And my odbc.ini, [DEFAULT]=dsnname
    ------------------------------------------------------
    [DEFAULT]
    Driver = ODBC Driver 18 for SQL Server
    Server = SERVER.IP.NUMBER
    Port = 1433
    User = dbuser
    Password = dbpassword
    Database = dbname
    Encrypt = yes
    TrustServerCertificate = yes

  • πŸ‡¬πŸ‡§United Kingdom pstewart

    Actually it may be possible to support 9.x and 10.x in the same branch by creating a wrapper interface using interface_exists.

  • πŸ‡ΈπŸ‡ͺSweden arne_hortell

    it turned out that
    1. i had to remove composer.lock
    2. run composer self-update
    this because composer had problems with symphony

    3. run composer update
    4. set settings.php as you said with
    trust_server_certificate=1
    5. then do a db install with drush
    6. then go to site and wait forever

  • πŸ‡ΈπŸ‡ͺSweden arne_hortell

    odbc is not necessary at all for this

  • πŸ‡¬πŸ‡§United Kingdom pstewart

    A quick update for everyone: I am now a maintainer on the project, and have just release 4.3.2 with existing RTBC bug fixes plus the feature for adding SQL Server specific DSN options. D10 compatibility work will progress in a new 4.4.x branch, with 4.3.x potentially receiving one more release to resolve the users table uid schema change issues.

  • πŸ‡¬πŸ‡§United Kingdom pstewart
  • I managed to set up a small Drupal 10 site on Windows using this sqlsrv driver 4.3.1 with a few changes. It's been running for the past month or two with no database issues I'm aware of since the initial troubleshooting/setup. I haven't reviewed the entire module for other changes that might be needed, run any testing tools or tried every possible Drupal function but the site works. Below is a log of what I did to fix each issue I encountered as a problem/solution list. I hope this helps with this effort, and I would be happy to help test any patches and the final version. It looks like the two patches I needed have since been committed to 4.3.2 or 4.4.x-dev, so that leaves my own changes below (or something similar) that is still needed.

    PHP Fatal error: Declaration of Drupal\sqlsrv\Driver\Database\sqlsrv\Schema::createTableSql($name, array $table)
    must be compatible with Drupal\Core\Database\Schema::createTableSql($name, $table)
    in D:\inetpub\wwwroot\drupal\modules\sqlsrv\src\Driver\Database\sqlsrv\Schema.php on line 1235
    fix: patch Schema.php to remove "array " from declaration:
    old line 1235: protected function createTableSql($name, array $table) {
    new line 1235: protected function createTableSql($name, $table) {

    Error: Call to a member function fetchField() on null in D:\inetpub\wwwroot\drupal\modules\sqlsrv\src\Driver\Database\sqlsrv\Schema.php on line 765
    fix: install patch from https://www.drupal.org/project/sqlsrv/issues/3291199 πŸ› Call to a member function fetchField() on null Fixed "Call to a member function fetchField() on null"

    PHP Warning: Undefined array key "default" in D:\inetpub\wwwroot\drupal\modules\sqlsrv\src\Driver\Database\sqlsrv\Connection.php on line 660
    same warning on line 686
    could occur on other nearby lines
    see: https://www.drupal.org/node/3257198 β†’
    fix: replace code in Connection.php in setPrefix($prefix) and tablePrefix($table = 'default')
    new version of Connection.php attached as text file (includes next item too).

    Message on Drupal installation page "Requirements problem" (step 3 Verify Requirements): Database connection does not support JSON.
    fix: install patch #5 from https://www.drupal.org/project/sqlsrv/issues/3332118 πŸ“Œ Database JSON support required Fixed "Database JSON support required"

    Drupal\Core\Extension\MissingDependencyException: Unable to install modules: module 'sqlsrv' is incompatible with this version of Drupal core.
    fix: patch modules\sqlsrv\sqlsrv.info.yml, change core_version_requirement: ^9.3 to ^10 (my changes are specific to Drupal 10, not for 9 anymore).

  • πŸ‡¬πŸ‡§United Kingdom pstewart

    @JerryACSA I think everything you have listed is committed in to the 4.4.x branch:

    It's encouraging to hear you've been running successfully for a while with essentially the same set of changes as the current 4.4.x branch. If you're able to try out the current 4.4.x-dev that would be great!

  • πŸ‡ΊπŸ‡ΈUnited States .Kris.

    Hello,

    I am trying to upgrade a site from 9.5.11 to 10.1.6 and I am receiving this message:

    PHP Fatal error: Declaration of Drupal\sqlsrv\Driver\Database\sqlsrv\Schema::createTableSql($name, array $table) must be compatible with Drupal\Core\Database\Schema::createTableSql($name, $table) in F:\WebSites\website\web\modules\composer\sqlsrv\src\Driver\Database\sqlsrv\Schema.php on line 1235

    I am using version 4.4.0-beta2 of the Drupal sqlsrv module.

  • Hi .Kris.,

    The issue you describe was fixed a few versions ago, and the Schema.php file from 4.4.0-beta2 contains the fixed version. I would check the installed version again and try reinstalling 4.4.0-beta2 if needed. You can fix that specific issue by editing the file mentioned in your error message and removing the word "array" from line 1235, but I would be concerned you may be missing other fixes.

    F:\WebSites\website\web\modules\composer\sqlsrv\src\Driver\Database\sqlsrv\Schema.php on line 1235
Production build 0.69.0 2024