mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Checking for existence of draft and live records in SilverStripeNavigatorItem_ArchiveLink->getHTML() (from r115130)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@115442 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3e8cc481f0
commit
c336545cd7
@ -161,7 +161,10 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
|
||||
// Display the archive link if the page currently displayed in the CMS is other version than live and draft
|
||||
$currentDraft = Versioned::get_one_by_stage('SiteTree', 'Draft', '"SiteTree"."ID" = ' . $page->ID);
|
||||
$currentLive = Versioned::get_one_by_stage('SiteTree', 'Live', '"SiteTree"."ID" = ' . $page->ID);
|
||||
if ($currentDraft && $currentLive && $page->Version != $currentDraft->Version && $page->Version != $currentLive->Version) {
|
||||
if(
|
||||
(!$currentDraft || ($currentDraft && $page->Version != $currentDraft->Version))
|
||||
&& (!$currentLive || ($currentLive && $page->Version != $currentLive->Version))
|
||||
) {
|
||||
$pageLink = $page->AbsoluteLink();
|
||||
return "<a href=\"$pageLink?archiveDate={$page->LastEdited}\" class=\"newWindow\" target=\"site\" style=\"left : -3px;\">". _t('ContentController.ARCHIVEDSITE', 'Archived Site') ."</a>";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user