mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 01:31:22 +02:00
BUG Error if invalid stage specified for get_by_stage
This commit is contained in:
parent
d9261af1f3
commit
02cd32acb3
@ -1481,7 +1481,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
|
|||||||
*/
|
*/
|
||||||
public static function get_by_stage($class, $stage, $filter = '', $sort = '', $join = '', $limit = '',
|
public static function get_by_stage($class, $stage, $filter = '', $sort = '', $join = '', $limit = '',
|
||||||
$containerClass = 'DataList') {
|
$containerClass = 'DataList') {
|
||||||
|
VersionedReadingMode::validateStage($stage);
|
||||||
$result = DataObject::get($class, $filter, $sort, $join, $limit, $containerClass);
|
$result = DataObject::get($class, $filter, $sort, $join, $limit, $containerClass);
|
||||||
return $result->setDataQueryParam(array(
|
return $result->setDataQueryParam(array(
|
||||||
'Versioned.mode' => 'stage',
|
'Versioned.mode' => 'stage',
|
||||||
|
Loading…
Reference in New Issue
Block a user