BUG Error if invalid stage specified for get_by_stage

This commit is contained in:
Damian Mooyman 2018-06-11 15:04:43 +12:00
parent d9261af1f3
commit 02cd32acb3
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -1481,7 +1481,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
*/
public static function get_by_stage($class, $stage, $filter = '', $sort = '', $join = '', $limit = '',
$containerClass = 'DataList') {
VersionedReadingMode::validateStage($stage);
$result = DataObject::get($class, $filter, $sort, $join, $limit, $containerClass);
return $result->setDataQueryParam(array(
'Versioned.mode' => 'stage',