Skip to content

Commit

Permalink
Fix Versioned::augmentSQL() when the data query was null.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshort committed Oct 3, 2013
1 parent bb7c973 commit deb1bfb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions model/Versioned.php
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 deb1bfb

Please sign in to comment.