mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
7a27650297
commit
55e1619c59
2 changed files with 8 additions and 4 deletions
|
@ -305,7 +305,7 @@ class TranslateBehavior extends ModelBehavior {
|
|||
}
|
||||
} else {
|
||||
$value = '';
|
||||
if (is_numeric($row[$Model->alias][$aliasVirtual]) || !empty($row[$Model->alias][$aliasVirtual])) {
|
||||
if (isset($row[$Model->alias][$aliasVirtual])) {
|
||||
$value = $row[$Model->alias][$aliasVirtual];
|
||||
}
|
||||
$row[$Model->alias][$aliasField] = $value;
|
||||
|
|
|
@ -285,7 +285,9 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
|
||||
$TestModel = new TranslatedItem();
|
||||
$TestModel->locale = 'eng';
|
||||
$result = $TestModel->find('all', array('conditions' => array('slug' => 'first_translated')));
|
||||
$result = $TestModel->find('all', array(
|
||||
'conditions' => array('slug' => 'first_translated')
|
||||
));
|
||||
$expected = array(
|
||||
array(
|
||||
'TranslatedItem' => array(
|
||||
|
@ -300,10 +302,12 @@ class TranslateBehaviorTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = $TestModel->find('count', array('conditions' => "TranslatedItem.slug = 'first_translated'"));
|
||||
$result = $TestModel->find('count', array(
|
||||
'conditions' => array('slug' => 'first_translated')
|
||||
));
|
||||
$expected = 1;
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* testLocaleSingleAssociations method
|
||||
|
|
Loading…
Reference in a new issue