diff --git a/code/DocumentationSearch.php b/code/DocumentationSearch.php index d934e7a..f59e691 100755 --- a/code/DocumentationSearch.php +++ b/code/DocumentationSearch.php @@ -182,8 +182,9 @@ class DocumentationSearch { * @return string */ public function get_index_location() { - if(!self::$index_location) + if(!self::$index_location) { self::$index_location = DOCSVIEWER_DIR; + } return Controller::join_links( TEMP_FOLDER, diff --git a/code/controllers/DocumentationViewer.php b/code/controllers/DocumentationViewer.php index 7b842cb..a40cfd3 100755 --- a/code/controllers/DocumentationViewer.php +++ b/code/controllers/DocumentationViewer.php @@ -14,7 +14,7 @@ class DocumentationViewer extends Controller { - static $allowed_actions = array( + public static $allowed_actions = array( 'home', 'LanguageForm', 'doLanguageForm', @@ -135,8 +135,9 @@ class DocumentationViewer extends Controller { */ public function handleRequest(SS_HTTPRequest $request, DataModel $model) { // if we submitted a form, let that pass - if(!$request->isGET() || isset($_GET['action_results'])) - return parent::handleRequest($request); + if(!$request->isGET() || isset($_GET['action_results'])) { + return parent::handleRequest($request, $model); + } $firstParam = ($request->param('Action')) ? $request->param('Action') : $request->shift(); $secondParam = $request->shift(); diff --git a/code/tasks/RebuildLuceneDocsIndex.php b/code/tasks/RebuildLuceneDocsIndex.php index 10aab5b..72b4d2a 100755 --- a/code/tasks/RebuildLuceneDocsIndex.php +++ b/code/tasks/RebuildLuceneDocsIndex.php @@ -32,6 +32,8 @@ class RebuildLuceneDocsIndex extends BuildTask { $lock = DocumentationSearch::get_index_location() .'/write.lock.file'; $lockFileFresh = (file_exists($lock) && filemtime($lock) > (time() - (60 * 60 * 24))); + echo "Building index in ". DocumentationSearch::get_index_location() . PHP_EOL; + if($lockFileFresh && !isset($_REQUEST['flush'])) { if(!$quiet) { echo "Index recently rebuilt. If you want to force reindex use ?flush=1";