BUGFIX Fixed SQLite3Database::enumValuesForField() from returning an array with NULL values

This commit is contained in:
Sean Harvey 2010-04-07 03:25:21 +00:00
parent bc1cd7008e
commit 98a59cad7b

View File

@ -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;
} }
/** /**