From 2257e0fb311e0f7dfe087e19fa132144d0970fc2 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Tue, 16 Dec 2014 23:18:54 +1300 Subject: [PATCH] FIX entities not describing state should still show If an entity does not provide a lang / version, keep showing it across menu. Resolves #53 --- code/controllers/DocumentationViewer.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/code/controllers/DocumentationViewer.php b/code/controllers/DocumentationViewer.php index 3c9fa69..6465987 100755 --- a/code/controllers/DocumentationViewer.php +++ b/code/controllers/DocumentationViewer.php @@ -316,15 +316,19 @@ class DocumentationViewer extends Controller { $current = $this->getEntity(); foreach($entities as $entity) { + $checkLang = $entity->getLanguage(); + $checkVers = $entity->getVersion(); - // only show entities with the same language - if($entity->getLanguage() !== $this->getLanguage()) { + // only show entities with the same language or any entity that + // isn't registered under any particular language (auto detected) + if($checkLang && $checkLang !== $this->getLanguage()) { continue; } - - // only show entities with the same version - if($entity->getVersion() !== $current->getVersion()) { - continue; + + if($current && $checkVers) { + if($entity->getVersion() !== $current->getVersion()) { + continue; + } } $mode = 'link'; @@ -459,7 +463,7 @@ class DocumentationViewer extends Controller { * @return ArrayList */ public function getVersions() { - return $this->manifest->getVersions($this->getEntity()); + return $this->getManifest()->getVersions($this->getEntity()); } /**