Skip to content

Commit

Permalink
FIX Add missing published state filter
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Mar 1, 2018
1 parent fe9f729 commit 222eec8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GraphQL/Resolvers/ApplyVersionFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public function applyToList(&$list, $versioningArgs)
$conditions[] = "\"{$liveTable}\".\"ID\" IS NULL AND \"{$draftTable}\".\"ID\" IS NOT NULL";
}

if (in_array('published', $statuses)) {
$conditions[] = "\"{$liveTable}\".\"ID\" IS NOT NULL";
}

// Validate that all statuses have been handled
if (empty($conditions) || count($statuses) !== count($conditions)) {
throw new InvalidArgumentException("Invalid statuses provided");
Expand Down

0 comments on commit 222eec8

Please sign in to comment.