diff --git a/src/Versioned.php b/src/Versioned.php index 087fc298..9c3fbe49 100644 --- a/src/Versioned.php +++ b/src/Versioned.php @@ -655,6 +655,9 @@ protected function prepareMaxVersionSubSelect(SQLSelect $baseQuery, DataQuery $d // We can ONLY promote a filter on the primary key of the base table. Any other conditions will make the // version returned incorrect, as we are filtering out version that may be the latest (and correct) version foreach ($baseQuery->getWhere() as $condition) { + if (is_object($condition)) { + continue; + } $conditionClause = key($condition); // Pull out the table and field for this condition. We'll skip anything we can't parse if (preg_match('/^"([^"]+)"\."([^"]+)"/', $conditionClause, $matches) !== 1) {