Skip to content

Commit

Permalink
Merge pull request #2482 from ajshort/pull-2
Browse files Browse the repository at this point in the history
Fix Versioned::augmentSQL() when the data query was null.
  • Loading branch information
simonwelsh committed Mar 15, 2014
2 parents 42c90ae + deb1bfb commit 5b22153
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions model/Versioned.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ public function augmentDataQueryCreation(SQLQuery &$query, DataQuery &$dataQuery
* @todo Should this all go into VersionedDataQuery?
*/
public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
if(!$dataQuery || !$dataQuery->getQueryParam('Versioned.mode')) {
return;
}

$baseTable = ClassInfo::baseDataClass($dataQuery->dataClass());

switch($dataQuery->getQueryParam('Versioned.mode')) {
// Noop
case '':
break;

switch($dataQuery->getQueryParam('Versioned.mode')) {
// Reading a specific data from the archive
case 'archive':
$date = $dataQuery->getQueryParam('Versioned.date');
Expand Down

0 comments on commit 5b22153

Please sign in to comment.