From 27f3dfc6ed32e37cb589901135682c0cf0c1e603 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Jan 2010 00:02:06 +0000 Subject: [PATCH] BUGFIX: Fixed viewing of deleted pages. (from r89833) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96795 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSSiteTreeFilter.php | 2 +- tests/CMSMainTest.php | 9 ++++++++- tests/CMSMainTest.yml | 10 ++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/code/CMSSiteTreeFilter.php b/code/CMSSiteTreeFilter.php index 3e6ae89f..ce5c3b99 100644 --- a/code/CMSSiteTreeFilter.php +++ b/code/CMSSiteTreeFilter.php @@ -79,7 +79,7 @@ class CMSSiteTreeFilter_DeletedPages extends CMSSiteTreeFilter { } function getTree() { - $leftAndMain = new LeftAndMain(); + $leftAndMain = new CMSMain(); $tree = $leftAndMain->getSiteTreeFor('SiteTree', isset($_REQUEST['ID']) ? $_REQUEST['ID'] : 0, "AllHistoricalChildren"); // Trim off the outer tag diff --git a/tests/CMSMainTest.php b/tests/CMSMainTest.php index b3ad8afa..3ab1fd4f 100644 --- a/tests/CMSMainTest.php +++ b/tests/CMSMainTest.php @@ -36,7 +36,7 @@ class CMSMainTest extends FunctionalTest { $response = Director::test("admin/cms/publishall", array('confirm' => 1), $this->session()); $this->assertContains( - sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 5), + sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 7), $response->getBody() ); @@ -156,4 +156,11 @@ class CMSMainTest extends FunctionalTest { $this->assertEquals('5', $newPage->ParentID); } + + function testDeletedPagesSiteTreeFilter() { + $id = $this->idFromFixture('Page', 'page3'); + $this->logInWithPermssion('ADMIN'); + $result = $this->get('admin/getfilteredsubtree?filter=CMSSiteTreeFilter_DeletedPages&ajax=1&ID=' . $id); + $this->assertEquals(200, $result->getStatusCode()); + } } diff --git a/tests/CMSMainTest.yml b/tests/CMSMainTest.yml index 0b7fc3f5..2288554f 100644 --- a/tests/CMSMainTest.yml +++ b/tests/CMSMainTest.yml @@ -4,9 +4,15 @@ Page: page2: Title: Page 2 page3: - Title: Page 2 + Title: Page 3 + page31: + Title: Page 3.1 + Parent: =>Page.page3 + page32: + Title: Page 3.2 + Parent: =>Page.page3 page4: - Title: Page 2 + Title: Page 4 home: Title: Home URLSegment: home