diff --git a/src/Symbiote/Elastica/ResultList.php b/src/Symbiote/Elastica/ResultList.php index 702ef6d..99f9548 100644 --- a/src/Symbiote/Elastica/ResultList.php +++ b/src/Symbiote/Elastica/ResultList.php @@ -155,8 +155,10 @@ public function toArray($evaluatePermissions = false, $loadDataObjects = true) { } // a double sanity check for the stage here. + $source = $item->getSource(); + $stages = isset($source['SS_Stage']) ? $source['SS_Stage'] : []; if ($currentStage = \Versioned::current_stage()) { - if ($currentStage != $stage) { + if ($currentStage != $stage && !in_array($currentStage, $stages)) { continue; } } @@ -164,7 +166,7 @@ public function toArray($evaluatePermissions = false, $loadDataObjects = true) { if (class_exists($type) && $loadDataObjects) { $object = \DataObject::get_by_id($type, $id); } else { - $object = \ArrayData::create($item->getSource()); + $object = \ArrayData::create($source); }