Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

3 participants

Andrew Short Sean Harvey Simon Welsh
Andrew Short

No description provided.

Sean Harvey
Owner

What's the context of this? A unit test might help to explain the case where this is a problem.

Sean Harvey
Owner

Hasn't had a reply for a month. @ajshort ? :)

Simon Welsh simonwelsh merged commit 5b22153 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 model/Versioned.php
10 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');
Something went wrong with that request. Please try again.