mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02: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');
|
||||
|
||||
if(is_dir($docs)) {
|
||||
self::register($entity, $docs, '', $entity, true);
|
||||
self::register($entity, $docs, 'current', $entity, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -345,8 +345,7 @@ class DocumentationViewer extends Controller {
|
||||
|
||||
foreach($versions as $key => $version) {
|
||||
$linkingMode = ($currentVersion == $version) ? 'current' : 'link';
|
||||
|
||||
if(!$version) $version = 'Current';
|
||||
|
||||
$output->push(new ArrayData(array(
|
||||
'Title' => $version,
|
||||
'Link' => $this->Link(implode('/',$this->Remaining), $entity->getFolder(), $version),
|
||||
|
Loading…
Reference in New Issue
Block a user