Permalink
Browse files

Return value if value are 0

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 a4f138813bce6dc7326f6d2274fe6f8c84ec584b
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/Model/Behavior/TranslateBehavior.php
@@ -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;

0 comments on commit a4f1388

Please sign in to comment.