mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: the function makes an assumption we are working on Draft site, and breaks if we are not. Rewritten to be stage-independent, as get_version (open #5231)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101603 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
28c0d8171b
commit
4bd3712206
@ -534,6 +534,10 @@ class Versioned extends DataObjectDecorator {
|
||||
* @param string $filter
|
||||
*/
|
||||
function allVersions($filter = "", $sort = "", $limit = "", $join = "", $having = "") {
|
||||
// Make sure the table names are not postfixed (e.g. _Live)
|
||||
$oldMode = self::get_reading_mode();
|
||||
self::reading_stage('Stage');
|
||||
|
||||
$query = $this->owner->extendedSQL($filter, $sort, $limit, $join, $having);
|
||||
|
||||
foreach($query->from as $table => $tableJoin) {
|
||||
@ -558,6 +562,7 @@ class Versioned extends DataObjectDecorator {
|
||||
$versions->push(new Versioned_Version($record));
|
||||
}
|
||||
|
||||
Versioned::set_reading_mode($oldMode);
|
||||
return $versions;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user