Skip to content

Commit

Permalink
Return value if value are 0
Browse files Browse the repository at this point in the history
Save correctly if the value is 0, but after the find is returned as an empty string.
  • Loading branch information
rdonadono committed Jan 3, 2014
1 parent cfa1045 commit a4f1388
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Cake/Model/Behavior/TranslateBehavior.php
Expand Up @@ -305,7 +305,9 @@ public function afterFind(Model $Model, $results, $primary = false) {
}
} else {
$value = '';
if (!empty($row[$Model->alias][$aliasVirtual])) {
if (is_numeric($row[$Model->alias][$aliasVirtual])) {
$value = $row[$Model->alias][$aliasVirtual];
} elseif (!empty($row[$Model->alias][$aliasVirtual])) {
$value = $row[$Model->alias][$aliasVirtual];
}
$row[$Model->alias][$aliasField] = $value;
Expand Down

0 comments on commit a4f1388

Please sign in to comment.