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:
martimiz 2013-01-07 16:41:07 +01:00
parent 5d9feb3fe5
commit 58d4f242b0
2 changed files with 2 additions and 3 deletions

View File

@ -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);
}
}
}

View File

@ -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),