Jump to:

23457 Posts in 18905 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Search: Missing argument 2 for Page_Controller::results

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

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

Page: 1
Go to End
Author Topic: 1136 Views
  • Double-A-Ron
    Community Member
    604 Posts

    Search: Missing argument 2 for Page_Controller::results Link to this post

    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.

  • ck_bullet
    Community Member
    16 Posts

    Re: Search: Missing argument 2 for Page_Controller::results Link to this post

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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.