Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Search: Missing argument 2 for Page_Controller::results

Go to End

2 Posts   1621 Views


Community Member, 607 Posts

6 June 2010 at 12:17pm

All of a sudden, one of my search systems (SS 2.3.1) has started doing this. Nothing has changed on the site for literally months. I have found one post in these forums from 2 years ago with the exact same problem, however noone responded to the guy.

Full error:
[Warning] Missing argument 2 for Page_Controller::results(), called in /home/zanzomedia/site/sapphire/core/control/Controller.php on line 162 and defined
GET /home/results?formController=home%2F&executeForm=SearchForm&Search=test&action_results.x=16&action_results.y=7&action_results=Go

Line 126 in /home/zanzomedia/site/mysite/code/Page.php

117 );
119 $actions = new FieldSet(
120 new FormAction('results', 'Search')
121 );
123 return new SearchForm($this, "SearchForm", $fields, $actions);
124 }
126 function results($data, $form){
127 $data = array(
128 'Results' => $form->getResults(),
129 'Query' => $form->getSearchQuery(),
130 'Title' => 'Viva Expeditions Search Results'
131 );


* Page_Controller->results(HTTPRequest)
Line 162 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 107 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 28 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(home/results)
Line 115 of main.php

Any ideas what this error pertains to and why it would appear for no reason? The code is straight out of the tutorial, although the form is hardcoded.


Community Member, 16 Posts

4 August 2010 at 6:37am

Any thoughts on this? I'm having the same problem as well.