From c5fb7127ac7a0d1705ea850661f2b51476317a35 Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Fri, 4 Nov 2016 17:55:24 +1300 Subject: [PATCH] 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. --- code/Controllers/CMSPageHistoryController.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/code/Controllers/CMSPageHistoryController.php b/code/Controllers/CMSPageHistoryController.php index c023fc70..bc6b2989 100644 --- a/code/Controllers/CMSPageHistoryController.php +++ b/code/Controllers/CMSPageHistoryController.php @@ -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(