diff --git a/code/controller/CMSMain.php b/code/controller/CMSMain.php
index <HASH>..<HASH> 100755
--- a/code/controller/CMSMain.php
+++ b/code/controller/CMSMain.php
@@ -497,6 +497,19 @@ JS;
 
 		return $form;
 	}
+	
+	public function currentPageID() {
+		$id = parent::currentPageID();
+		
+		// Fall back to homepage record
+		if(!$id) {
+			$homepageSegment = RootURLController::get_homepage_link();
+			$homepageRecord = DataObject::get_one('SiteTree', sprintf('"URLSegment" = \'%s\'', $homepageSegment));
+			if($homepageRecord) $id = $homepageRecord->ID;
+		}
+		
+		return $id;
+	}
 
 	//------------------------------------------------------------------------------------------//
 	// Data saving handlers
MINOR Fall back to homepage record for CMSMain->PreviewLink()