From 735e6466262804feab714d3b767ec8f189598b8e Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Mon, 31 Oct 2011 12:15:07 +1300 Subject: [PATCH] BUGFIX $date is not set on SilverStripeNavigatorItem_ArchiveLink This bug was introduced from a bad merge --- code/controller/SilverStripeNavigator.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/controller/SilverStripeNavigator.php b/code/controller/SilverStripeNavigator.php index 1c29aaed..030d453c 100644 --- a/code/controller/SilverStripeNavigator.php +++ b/code/controller/SilverStripeNavigator.php @@ -298,9 +298,11 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem { } function getMessage() { - $dateObj = Object::create('Datetime'); - $dateObj->setValue($date); - return "
". _t('ContentController.ARCHIVEDSITEFROM', 'Archived site from') ."
" . $dateObj->Nice() . "
"; + if($date = Versioned::current_archived_date()) { + $dateObj = Object::create('Datetime'); + $dateObj->setValue($date); + return "
". _t('ContentController.ARCHIVEDSITEFROM', 'Archived site from') ."
" . $dateObj->Nice() . "
"; + } } function getLink() {