mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
FIX entities not describing state should still show
If an entity does not provide a lang / version, keep showing it across menu. Resolves #53
This commit is contained in:
parent
7b9dbf75bb
commit
2257e0fb31
@ -316,16 +316,20 @@ class DocumentationViewer extends Controller {
|
|||||||
$current = $this->getEntity();
|
$current = $this->getEntity();
|
||||||
|
|
||||||
foreach($entities as $entity) {
|
foreach($entities as $entity) {
|
||||||
|
$checkLang = $entity->getLanguage();
|
||||||
|
$checkVers = $entity->getVersion();
|
||||||
|
|
||||||
// only show entities with the same language
|
// only show entities with the same language or any entity that
|
||||||
if($entity->getLanguage() !== $this->getLanguage()) {
|
// isn't registered under any particular language (auto detected)
|
||||||
|
if($checkLang && $checkLang !== $this->getLanguage()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only show entities with the same version
|
if($current && $checkVers) {
|
||||||
if($entity->getVersion() !== $current->getVersion()) {
|
if($entity->getVersion() !== $current->getVersion()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$mode = 'link';
|
$mode = 'link';
|
||||||
$children = new ArrayList();
|
$children = new ArrayList();
|
||||||
@ -459,7 +463,7 @@ class DocumentationViewer extends Controller {
|
|||||||
* @return ArrayList
|
* @return ArrayList
|
||||||
*/
|
*/
|
||||||
public function getVersions() {
|
public function getVersions() {
|
||||||
return $this->manifest->getVersions($this->getEntity());
|
return $this->getManifest()->getVersions($this->getEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user