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 array
*/
public function enumValuesForField($tableName, $fieldName) {
$classnameinfo = DB::query("SELECT EnumList FROM SQLiteEnums WHERE TableColumn = \"{$tableName}.{$fieldName}\"")->first();
$return = explode(',', $classnameinfo['EnumList']);
//for($i=0; $i<count($return);$i++) $return[$i] = trim($return[$i]);
return $return;
$output = array();
if($classnameinfo) {
$output = explode(',', $classnameinfo['EnumList']);
}
return $output;
}
/**