Merge pull request #41 from mattclegg/master

Merge pull request #41 from mattclegg/master
This commit is contained in:
Will Rossiter 2012-08-22 00:27:20 -07:00
commit ac4e6f2b56
2 changed files with 3 additions and 5 deletions

View File

@ -78,8 +78,6 @@ class BlogEntry extends Page {
$fields->addFieldToTab("Root.Main", new TextField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)")),"Content"); $fields->addFieldToTab("Root.Main", new TextField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)")),"Content");
$this->extend('updateCMSFields', $fields);
return $fields; return $fields;
} }

View File

@ -61,12 +61,12 @@ class BlogTree extends Page {
if($top) return $top; if($top) return $top;
// Try to find any BlogTree that is not inside another BlogTree // Try to find any BlogTree that is not inside another BlogTree
foreach(DataObject::get('BlogTree') as $tree) { if($blogTrees=DataObject::get('BlogTree')) foreach($blogTrees as $tree) {
if(!($tree->getParent() instanceof BlogTree)) return $tree; if(!($tree->getParent() instanceof BlogTree)) return $tree;
} }
// This shouldn't be possible, but assuming the above fails, just return anything you can get // This shouldn't be possible, but assuming the above fails, just return anything you can get
return DataObject::get_one('BlogTree'); return $blogTrees->first();
} }
/* ----------- ACCESSOR OVERRIDES -------------- */ /* ----------- ACCESSOR OVERRIDES -------------- */
@ -349,4 +349,4 @@ class BlogTree_Controller extends Page_Controller {
return date("Y", mktime(0, 0, 0, date('m'), 1, $date)); return date("Y", mktime(0, 0, 0, date('m'), 1, $date));
} }
} }
} }