Skip to content

Commit

Permalink
Fixing bug where DBObject autoColumns did not exclude the idColumnNam…
Browse files Browse the repository at this point in the history
…e field.
  • Loading branch information
Tyler Hall committed Jul 8, 2011
1 parent 3185af4 commit af0e9fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/class.dbobject.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ protected function __construct($table_name, $columns_or_id = null, $id = null)
$db = Database::getDatabase();
$rows = $db->getRows('SHOW COLUMNS FROM `' . $this->tableName . '`');
foreach($rows as $row)
self::$autoColumns[$this->className][] = $row['Field'];
{
if(strtolower($row['Field']) != strtolower($this->idColumnName))
self::$autoColumns[$this->className][] = $row['Field'];
}
}

if(isset($columns_or_id))
Expand Down

0 comments on commit af0e9fa

Please sign in to comment.