mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
Fix: Search returns no results for auto-registered modules
Automatic registration sets the version to '' (empty). This breaks the search as Lucene Search will return an Empty query object if a subquery has an empty key. Fix: register the modules as 'current' instead of ''. Setting the version title to 'current' in DocumentViewer->getVersions() is now no longer necessary.
This commit is contained in:
parent
5d9feb3fe5
commit
58d4f242b0
@ -277,7 +277,7 @@ class DocumentationService {
|
|||||||
$docs = Director::baseFolder() . '/' . Controller::join_links($entity, 'docs');
|
$docs = Director::baseFolder() . '/' . Controller::join_links($entity, 'docs');
|
||||||
|
|
||||||
if(is_dir($docs)) {
|
if(is_dir($docs)) {
|
||||||
self::register($entity, $docs, '', $entity, true);
|
self::register($entity, $docs, 'current', $entity, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,6 @@ class DocumentationViewer extends Controller {
|
|||||||
foreach($versions as $key => $version) {
|
foreach($versions as $key => $version) {
|
||||||
$linkingMode = ($currentVersion == $version) ? 'current' : 'link';
|
$linkingMode = ($currentVersion == $version) ? 'current' : 'link';
|
||||||
|
|
||||||
if(!$version) $version = 'Current';
|
|
||||||
$output->push(new ArrayData(array(
|
$output->push(new ArrayData(array(
|
||||||
'Title' => $version,
|
'Title' => $version,
|
||||||
'Link' => $this->Link(implode('/',$this->Remaining), $entity->getFolder(), $version),
|
'Link' => $this->Link(implode('/',$this->Remaining), $entity->getFolder(), $version),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user