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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1698 Views

Avatar
Double-A-Ron

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
Source

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

Trace

* 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.

Avatar
ck_bullet

Community Member, 16 Posts

4 August 2010 at 6:37am

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