Skip to content
Snippets Groups Projects
Commit 0884151f authored by Damian Mooyman's avatar Damian Mooyman
Browse files

Merge pull request #1072 from madmatt/pulls/changed-pages

Fix changed pages filter to match SiteTree's 'MODIFIED' label
parents 3a5c5efc 4e5b1966
No related branches found
No related tags found
No related merge requests found
......@@ -300,7 +300,7 @@ class CMSSiteTreeFilter_ChangedPages extends CMSSiteTreeFilter {
$pages = Versioned::get_by_stage('SiteTree', 'Stage');
$pages = $this->applyDefaultFilters($pages)
->leftJoin('SiteTree_Live', '"SiteTree_Live"."ID" = "SiteTree"."ID"')
->where('"SiteTree"."Version" > "SiteTree_Live"."Version"');
->where('"SiteTree"."Version" <> "SiteTree_Live"."Version"');
return $pages;
}
}
......
......@@ -72,6 +72,17 @@ class CMSSiteTreeFilterTest extends SapphireTest {
$f = new CMSSiteTreeFilter_ChangedPages(array('Term' => 'No Matches'));
$results = $f->pagesIncluded();
$this->assertEquals(0, count($results));
// If we roll back to an earlier version than what's on the published site, we should still show the changed
$changedPage->Title = 'Changed 2';
$changedPage->publish('Stage', 'Live');
$changedPage->doRollbackTo(1);
$f = new CMSSiteTreeFilter_ChangedPages(array('Term' => 'Changed'));
$results = $f->pagesIncluded();
$this->assertEquals(1, count($results));
$this->assertEquals(array('ID' => $changedPage->ID, 'ParentID' => 0), $results[0]);
}
public function testDeletedPagesFilter() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment