- 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 -PpAssW0rdAny 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 symphony3. 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 - π¬π§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.
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:
- Schema.php fix: Committed in
efb2358
(this was a small enough change I didn't bother opening an issue for it) - Call to a member function fetchField() on null: Patch committed in #3291199 π Call to a member function fetchField() on null Fixed
- Table prefix issue: Patch committed in #3362458 π Table prefix handling not compatible with removal of per-table prefixing Fixed . It looks like you've taken a similar approach, however I think your version might have issues if a database-wide prefix is in use.
- JSON Requirements problem: Patch committed in #3332118 π Database JSON support required Fixed
- Version requirement: Committed in
dff92b0
(opens 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!
- Schema.php fix: Committed in
- πΊπΈ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