mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing virutal fields fetching for postgresql, closes #417
This commit is contained in:
parent
1d449e3847
commit
e4a5ca528c
2 changed files with 30 additions and 7 deletions
|
@ -1873,9 +1873,6 @@ class DboSource extends DataSource {
|
|||
}
|
||||
$fields = array_values(array_filter($fields));
|
||||
|
||||
if (!$quote) {
|
||||
return $fields;
|
||||
}
|
||||
$virtual = array();
|
||||
$virtualFields = $model->getVirtualField();
|
||||
if (!empty($virtualFields)) {
|
||||
|
@ -1892,6 +1889,13 @@ class DboSource extends DataSource {
|
|||
}
|
||||
$fields = array_values($fields);
|
||||
}
|
||||
|
||||
if (!$quote) {
|
||||
if (!empty($virtual)) {
|
||||
$fields = array_merge($fields, $this->_constructVirtualFields($model, $alias, $virtual));
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
$count = count($fields);
|
||||
|
||||
if ($count >= 1 && !in_array($fields[0], array('*', 'COUNT(*)'))) {
|
||||
|
|
|
@ -427,19 +427,19 @@ class DboPostgresTest extends CakeTestCase {
|
|||
4 0 obj
|
||||
<< /Length 5 0 R /Filter /FlateDecode >>
|
||||
stream
|
||||
xµYMì€∆Ω„WÃ%)nï0¯îâ-«é]Q"πXµáÿ•Ip - P |