mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
BUG Fixing search not working when no specific versions of docs
This commit is contained in:
parent
6eca5af929
commit
4a1e5436eb
@ -229,7 +229,6 @@ class DocumentationSearch {
|
|||||||
error_reporting('E_ALL ^ E_NOTICE');
|
error_reporting('E_ALL ^ E_NOTICE');
|
||||||
$this->results = $index->find($query);
|
$this->results = $index->find($query);
|
||||||
error_reporting($er);
|
error_reporting($er);
|
||||||
|
|
||||||
$this->totalResults = $index->numDocs();
|
$this->totalResults = $index->numDocs();
|
||||||
}
|
}
|
||||||
catch(Zend_Search_Lucene_Exception $e) {
|
catch(Zend_Search_Lucene_Exception $e) {
|
||||||
|
@ -828,7 +828,7 @@ class DocumentationViewer extends Controller {
|
|||||||
|
|
||||||
$form = new Form($this, 'DocumentationSearchForm', $fields, $actions);
|
$form = new Form($this, 'DocumentationSearchForm', $fields, $actions);
|
||||||
$form->disableSecurityToken();
|
$form->disableSecurityToken();
|
||||||
$form->setFormMethod('get');
|
$form->setFormMethod('GET');
|
||||||
$form->setFormAction(self::$link_base . 'DocumentationSearchForm');
|
$form->setFormAction(self::$link_base . 'DocumentationSearchForm');
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
@ -842,7 +842,7 @@ class DocumentationViewer extends Controller {
|
|||||||
function getSearchedEntities() {
|
function getSearchedEntities() {
|
||||||
$entities = array();
|
$entities = array();
|
||||||
|
|
||||||
if(isset($_REQUEST['Entities'])) {
|
if(!empty($_REQUEST['Entities'])) {
|
||||||
if(is_array($_REQUEST['Entities'])) {
|
if(is_array($_REQUEST['Entities'])) {
|
||||||
$entities = Convert::raw2att($_REQUEST['Entities']);
|
$entities = Convert::raw2att($_REQUEST['Entities']);
|
||||||
}
|
}
|
||||||
@ -866,7 +866,7 @@ class DocumentationViewer extends Controller {
|
|||||||
function getSearchedVersions() {
|
function getSearchedVersions() {
|
||||||
$versions = array();
|
$versions = array();
|
||||||
|
|
||||||
if(isset($_REQUEST['Versions'])) {
|
if(!empty($_REQUEST['Versions'])) {
|
||||||
if(is_array($_REQUEST['Versions'])) {
|
if(is_array($_REQUEST['Versions'])) {
|
||||||
$versions = Convert::raw2att($_REQUEST['Versions']);
|
$versions = Convert::raw2att($_REQUEST['Versions']);
|
||||||
$versions = array_combine($versions, $versions);
|
$versions = array_combine($versions, $versions);
|
||||||
@ -959,7 +959,7 @@ class DocumentationViewer extends Controller {
|
|||||||
|
|
||||||
$form = new Form($this, 'AdvancedSearchForm', $fields, $actions, $required);
|
$form = new Form($this, 'AdvancedSearchForm', $fields, $actions, $required);
|
||||||
$form->disableSecurityToken();
|
$form->disableSecurityToken();
|
||||||
$form->setFormMethod('get');
|
$form->setFormMethod('GET');
|
||||||
$form->setFormAction(self::$link_base . 'DocumentationSearchForm');
|
$form->setFormAction(self::$link_base . 'DocumentationSearchForm');
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user