mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 06:05:53 +00:00
FIX Silverstripe expects dates as strings
This commit is contained in:
parent
cc80227614
commit
0cc9a140cd
@ -57,6 +57,7 @@ class MSSQLAzureDatabase extends MSSQLDatabase
|
||||
{
|
||||
$parameters = $this->parameters;
|
||||
$parameters['database'] = $database;
|
||||
$parameters['returndatesasstrings'] = 1;
|
||||
$parameters['multipleactiveresultsets'] = 1;
|
||||
|
||||
// Ensure that driver is available (required by PDO)
|
||||
|
@ -45,7 +45,8 @@ class MSSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper
|
||||
// Azure has additional parameter requirements
|
||||
if ($this->isAzure($databaseConfig)) {
|
||||
$parameters['database'] = $databaseConfig['database'];
|
||||
$parameters['multipleactiveresultsets'] = 0;
|
||||
$parameters['multipleactiveresultsets'] = 1;
|
||||
$parameters['returndatesasstrings'] = 1;
|
||||
}
|
||||
|
||||
$conn = @sqlsrv_connect($databaseConfig['server'], $parameters);
|
||||
|
@ -47,13 +47,16 @@ class SQLServerConnector extends DBConnector
|
||||
}
|
||||
|
||||
$charset = isset($parameters['charset']) ? $parameters : 'UTF-8';
|
||||
$multiResultSets = isset($parameters['multipleactiveresultsets'])
|
||||
? $parameters['multipleactiveresultsets']
|
||||
: true;
|
||||
$options = array(
|
||||
|
||||
$options = [
|
||||
'CharacterSet' => $charset,
|
||||
'MultipleActiveResultSets' => $multiResultSets
|
||||
);
|
||||
'ReturnDatesAsStrings' => isset($parameters['returndatesasstrings'])
|
||||
? $parameters['returndatesasstrings']
|
||||
: true,
|
||||
'MultipleActiveResultSets' => isset($parameters['multipleactiveresultsets'])
|
||||
? $parameters['multipleactiveresultsets']
|
||||
: true
|
||||
];
|
||||
|
||||
if (!(defined('MSSQL_USE_WINDOWS_AUTHENTICATION') && MSSQL_USE_WINDOWS_AUTHENTICATION == true)
|
||||
&& empty($parameters['windowsauthentication'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user