FIX Page History 'Comparing versions' banner missing

The 'Comparing versions' banner was inserted before the "Title" field. If there is no "Title" field the banner is missing. If the "Title" field isn't the first field then the banner is in the incorrect place.
This commit is contained in:
Mike Cochrane 2016-11-04 17:55:24 +13:00 committed by GitHub
parent 5bd7662cb4
commit c5fb7127ac

View File

@ -174,13 +174,12 @@ class CMSPageHistoryController extends CMSMain {
}
}
$fields->addFieldToTab('Root.Main',
new LiteralField('CurrentlyViewingMessage', ArrayData::create(array(
'Content' => DBField::create_field('HTMLFragment', $message),
'Classes' => 'notice'
))->renderWith($this->getTemplatesWithSuffix('_notice'))),
"Title"
);
$fields->fieldByName('Root.Main')->unshift(
new LiteralField('CurrentlyViewingMessage', ArrayData::create(array(
'Content' => DBField::create_field('HTMLFragment', $message),
'Classes' => 'notice'
))->renderWith($this->getTemplatesWithSuffix('_notice')))
);
$form->setFields($fields->makeReadonly());
$form->loadDataFrom(array(