Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
This module is currently incompatible with Drupal 10. The main issue stems from the policy decision that all databases must support JSON functionality (https://www.drupal.org/node/3192484). SQL Server itself does, but it uses different function names and the module/driver does not translate the commonly used JSON requests.
Is a solution actively being worked on?
Issue fork sqlsrv-3332118
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
KenKodz CreditAttribution: KenKodz as a volunteer commentedLooking at the Drupal 10.0.x code, the only thing I see JSON related is the check to see if the DB engine supports JSON.
In MySQL (default method):
In PgSQL:
For sqlsrv, this should accomplish the same thing:
I'm still digging into the code to determine what other methods need to be added or changed. Anyone else wanting to work on this, we can discuss it here or in Slack.
Comment #4
KenKodz CreditAttribution: KenKodz as a volunteer commentedHere's a patch for the change mentioned above.
Comment #5
tevans CreditAttribution: tevans commentedI applied the patch, but was still seeing a warning on the Status Report that database support for JSON is not available. It looks like the syntax for the query wasn't quite right. Attaching a patch with the correct syntax that does appear to remove the warning.
Comment #6
KenKodz CreditAttribution: KenKodz as a volunteer commentedYeah, my code had a typo in it. Can confirm that #5 works.
Comment #7
pstewart CreditAttribution: pstewart at Imperial College Union commentedI ran into some trouble applying #5 as the file was formatted as UTF-16. This version of the patch is reformatted as UTF-8, but is otherwise identical to #5. Can confirm it works as expected talking to an SQL Server 2017 database.
As far as I can tell the
hasJson
method is the only thing we need to do at this stage, other stuff relating to json appears to be still active in core at the moment, such as mapping json data types in the schema API etc.Comment #8
pstewart CreditAttribution: pstewart at Imperial College Union commentedComment #9
pstewart CreditAttribution: pstewart at Imperial College Union commentedComment #11
pstewart CreditAttribution: pstewart at Imperial College Union commentedI've now committed this to 4.4.x for inclusion in the next dev release. I've encountered no issues with this when running the Drupal 10 installer with an SQL Server database, and have confirmed the Status Report shows 'Database support for JSON' as being 'Available'. I think this is therefore all done, however I'll keep this issue at 'Needs Review' while the 4.4.x branch is in development and testing, and we'll move to 'Fixed' once we're ready to release 4.4.0 as stable.
Comment #12
.Kris. CreditAttribution: .Kris. commentedHello,
I have installed 4.4.x-dev, but I am still getting this error when I run update.php, and it is not allowing me to do the upgrade:
Requirements problem
Errors found
Database support for JSON
Not available
Is required in Drupal 10.0.
Comment #13
.Kris. CreditAttribution: .Kris. commentedHere are the files in question (on left), compared to a clean install of Drupal 10.1 on the right:
Comment #14
pstewart CreditAttribution: pstewart at Imperial College Union commented@.Kris. What version of SQL Server are you currently using? Note that JSON support is only available in SQL Server 2016 (13.x) and later.
Comment #15
pstewart CreditAttribution: pstewart at Imperial College Union commented