mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Keep a more shared understanding of Archived
This commit is contained in:
parent
d7e64199a7
commit
0872a23aa8
@ -128,14 +128,7 @@ abstract class SilverStripeNavigatorItem extends ViewableData
|
||||
}
|
||||
|
||||
if (!isset($record->_cached_isArchived)) {
|
||||
$baseClass = $record->baseClass();
|
||||
$currentDraft = Versioned::get_by_stage($baseClass, Versioned::DRAFT)->byID($record->ID);
|
||||
$currentLive = Versioned::get_by_stage($baseClass, Versioned::LIVE)->byID($record->ID);
|
||||
|
||||
$record->_cached_isArchived = (
|
||||
(!$currentDraft || ($currentDraft && $record->Version != $currentDraft->Version))
|
||||
&& (!$currentLive || ($currentLive && $record->Version != $currentLive->Version))
|
||||
);
|
||||
$record->_cached_isArchived = $record->isArchived();
|
||||
}
|
||||
|
||||
return $record->_cached_isArchived;
|
||||
|
Loading…
Reference in New Issue
Block a user