diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index e925e87d..c791cfc2 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -781,7 +781,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $record->HasBrokenLink = 0; $record->HasBrokenFile = 0; - $record->writeWithoutVersion(); + if (!$record->ObsoleteClassName) $record->writeWithoutVersion(); // Update the class instance if necessary if(isset($data['ClassName']) && $data['ClassName'] != $record->ClassName) { diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 9c632dfa..06f7c961 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1803,7 +1803,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid if($this->HasBrokenLink || $this->HasBrokenFile) { $statusMessage[] = _t('SiteTree.HASBROKENLINKS', "This page has broken links."); } - + $dependentNote = ''; $dependentTable = new LiteralField('DependentNote', '

'); @@ -1877,6 +1877,20 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $tabMain->setTitle(_t('SiteTree.TABCONTENT', "Main Content")); + if($this->ObsoleteClassName) { + $obsoleteWarning = _t( + 'SiteTree.OBSOLETECLASS', + "This page is of obsolete type {type}. Saving will reset it's type and you may lose data", + array('type' => $this->ObsoleteClassName) + ); + + $fields->addFieldToTab( + "Root.Main", + new LiteralField("ObsoleteWarningHeader", "

$obsoleteWarning

"), + "Title" + ); + } + if(file_exists(BASE_PATH . '/install.php')) { $fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", "

" . _t("SiteTree.REMOVE_INSTALL_WARNING",