Permalink
Browse files

Fix Versioned::augmentSQL() when the data query was null.

  • Loading branch information...
1 parent bb7c973 commit deb1bfbcbaaa62acb2263ba797b5068e142a6353 @ajshort ajshort committed Oct 3, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 model/Versioned.php
View
@@ -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');

0 comments on commit deb1bfb

Please sign in to comment.