diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php
index 59b3481c..6b0293a7 100644
--- a/code/controllers/CMSMain.php
+++ b/code/controllers/CMSMain.php
@@ -251,9 +251,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$def[$class]['defaultChild'] = $defaultChild;
$defaultParent = $obj->defaultParent();
+ if(SiteTree::get_by_link($defaultParent)) {
$id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
-
+ }
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
if(is_array($def[$class]['disallowedChildren'])) {
diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php
index 4e787023..59bf093a 100644
--- a/code/model/SiteTree.php
+++ b/code/model/SiteTree.php
@@ -2465,22 +2465,23 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @return string
*/
function getTreeTitle() {
+ $text = Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle));
if($this->IsDeletedFromStage) {
if($this->ExistsOnLive) {
- $tag ="span class=\"del\" title=\"" . _t('SiteTree.REMOVEDFROMDRAFT', 'Removed from draft site') . "\"";
+ $tag ="{$text} " . _t('SiteTree.REMOVEDFROMDRAFT', 'Removed from draft site') . "";
} else {
- $tag ="span class=\"del\" class=\"deletedOnLive\" title=\"" . _t('SiteTree.DELETEDPAGE', 'Deleted page') . "\"";
+ $tag ="{$text} ". _t('SiteTree.DELETEDPAGE', 'Deleted page') . "";
}
} elseif($this->IsAddedToStage) {
- $tag = "span class=\"ins\" title=\"" . _t('SiteTree.ADDEDTODRAFT', 'Added to draft site') . "\"";
+ $tag = "{$text} ". _t('SiteTree.ADDEDTODRAFT', 'Added to draft site') . "";
} elseif($this->IsModifiedOnStage) {
- $tag = "span title=\"" . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "\" class=\"status modified\"";
+ $tag = "{$text} " . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "";
} else {
$tag = '';
}
- $text = Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle));
- return ($tag) ? ""."<$tag>" . $text . "" . strtok($tag,' ') . ">" : "". $text;
+
+ return ($tag) ? "". $tag : "". $text;
}
/**