#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:
Andrew O'Neil 2007-11-12 02:03:17 +00:00
parent 8f058227b0
commit 8360e8f8b8
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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() {
@ -85,4 +85,4 @@ class Sitemap extends Controller {
return array();
}
}
?>
?>