mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
#1707 - sitemap.xml needs to hide unpublished pages
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44619 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8f058227b0
commit
8360e8f8b8
@ -558,7 +558,7 @@ class Versioned extends DataObjectDecorator {
|
||||
* @param string $filter A filter to be inserted into the WHERE clause.
|
||||
* @return DataObject
|
||||
*/
|
||||
static function get_one_by_stage($class, $stage, $filter) {
|
||||
static function get_one_by_stage($class, $stage, $filter = '') {
|
||||
$oldStage = Versioned::$reading_stage;
|
||||
Versioned::$reading_stage = $stage;
|
||||
singleton($class)->flushCache();
|
||||
@ -569,7 +569,7 @@ class Versioned extends DataObjectDecorator {
|
||||
return $result;
|
||||
}
|
||||
|
||||
static function get_by_stage($class, $stage, $filter, $sort) {
|
||||
static function get_by_stage($class, $stage, $filter = '', $sort = '') {
|
||||
$oldStage = Versioned::$reading_stage;
|
||||
Versioned::$reading_stage = $stage;
|
||||
$result = DataObject::get($class, $filter, $sort);
|
||||
|
@ -9,7 +9,7 @@ class Sitemap extends Controller {
|
||||
protected $Pages;
|
||||
|
||||
function __construct() {
|
||||
$this->Pages=DataObject::get('SiteTree');
|
||||
$this->Pages = Versioned::get_by_stage('SiteTree', 'Live');
|
||||
}
|
||||
|
||||
public function Items() {
|
||||
|
Loading…
Reference in New Issue
Block a user