Show initial version in allchanges feed

This commit is contained in:
Robert Curry 2013-03-07 14:54:13 +13:00
parent c03d666fe9
commit 671bf57015
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<?php
Object::add_extension('Page', 'VersionFeed');
Object::add_extension('ContentController', 'VersionFeed_Controller');
SiteTree::add_extension('VersionFeed');
ContentController::add_extension('VersionFeed_Controller');

View File

@ -63,7 +63,9 @@ class VersionFeed extends SiteTreeExtension {
$previous = $version;
}
if ($fullHistory && $previous) {
// Push the first version on to the list - only if we're looking at the full history or if it's the first
// version in the version history.
if ($previous && ($fullHistory || $versions->count() == 1)) {
$first = clone($previous);
$first->DiffContent = new HTMLText();
$first->DiffContent->setValue('<div>' . $first->obj('Content')->forTemplate() . '</div>');