mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
BUGFIX Fixed SQLite3Database::enumValuesForField() from returning an array with NULL values
This commit is contained in:
parent
bc1cd7008e
commit
98a59cad7b
@ -780,12 +780,15 @@ class SQLite3Database extends SS_Database {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return enum values for the given field
|
* Return enum values for the given field
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function enumValuesForField($tableName, $fieldName) {
|
public function enumValuesForField($tableName, $fieldName) {
|
||||||
$classnameinfo = DB::query("SELECT EnumList FROM SQLiteEnums WHERE TableColumn = \"{$tableName}.{$fieldName}\"")->first();
|
$classnameinfo = DB::query("SELECT EnumList FROM SQLiteEnums WHERE TableColumn = \"{$tableName}.{$fieldName}\"")->first();
|
||||||
$return = explode(',', $classnameinfo['EnumList']);
|
$output = array();
|
||||||
//for($i=0; $i<count($return);$i++) $return[$i] = trim($return[$i]);
|
if($classnameinfo) {
|
||||||
return $return;
|
$output = explode(',', $classnameinfo['EnumList']);
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user