mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUGFIX Ensure that the ID is returned as a string when coming out of the database using the mssql_*() functions. This is NOT set to an integer, because there are many places in the sapphire framework that expect ID to be a string
This commit is contained in:
parent
7e45cfda78
commit
5bd3bcac67
@ -1454,6 +1454,9 @@ class MSSQLQuery extends SS_Query {
|
||||
|
||||
foreach($data as $columnIdx => $value) {
|
||||
$columnName = mssql_field_name($this->handle, $columnIdx);
|
||||
// There are many places in the framework that expect the ID to be a string, not a double
|
||||
// Do not set this to an integer, or it will cause failures in many tests that expect a string
|
||||
if($columnName == 'ID') $value = (string) $value;
|
||||
// $value || !$ouput[$columnName] means that the *last* occurring value is shown
|
||||
// !$ouput[$columnName] means that the *first* occurring value is shown
|
||||
if(isset($value) || !isset($output[$columnName])) {
|
||||
|
Loading…
Reference in New Issue
Block a user