Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix the `'joined'` strategy of `data\source\Database` to allow object…

… casted field.
  • Loading branch information...
commit 2ad6e529295a066d87c1b92f8dce49e181ea69ea 1 parent d0acd17
@jails jails authored
View
3  data/source/Database.php
@@ -232,6 +232,9 @@ public function __construct(array $config = array()) {
$models = $context->models();
foreach ($context->fields() as $field) {
+ if (!is_string($field)) {
+ continue;
+ }
list($alias, $field) = $self->invokeMethod('_splitFieldname', array($field));
$alias = $alias ?: $field;
if ($alias && isset($models[$alias])) {
View
2  tests/cases/data/source/DatabaseTest.php
@@ -1506,7 +1506,7 @@ public function testCustomField() {
$query = new Query(array(
'type' => 'read',
'model' => $this->_gallery,
- 'fields' => array('count(Image.id) as count', 'Image'),
+ 'fields' => array((object) 'count(Image.id) as count', 'Image'),
'group' => 'Gallery.id',
'with' => array('Image')
));
Please sign in to comment.
Something went wrong with that request. Please try again.