Fix: Search error on autoregistered entities

Error: [Warning] array_combine() [function.array-combine]: Both
parameters should have at least 1 element

HandleRequest for submitted forms returns before the automatic
registration of modules is performed, so no entities can be found.
Fixed by moving  DocumentationService::load_automatic_registration();
to the top of the function
This commit is contained in:
martimiz 2013-01-07 16:31:12 +01:00
parent 88660f12f5
commit 5d9feb3fe5

View File

@ -158,6 +158,8 @@ class DocumentationViewer extends Controller {
* @return SS_HTTPResponse
*/
public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
DocumentationService::load_automatic_registration();
// if we submitted a form, let that pass
if(!$request->isGET() || isset($_GET['action_results'])) {
return parent::handleRequest($request, $model);
@ -168,7 +170,6 @@ class DocumentationViewer extends Controller {
$thirdParam = $request->shift();
$this->Remaining = $request->shift(10);
DocumentationService::load_automatic_registration();
// if no params passed at all then it's the homepage
if(!$firstParam && !$secondParam && !$thirdParam) {