This topic is locked

Changing AutoSuggest Default Behavior

6/2/2011 6:33:10 PM
PHPRunner General questions
M
mwelkins author

I have searched the web and the documentation on how to change the default autosuggest behavior from finding your search string anywhere in a word, to finding only "starts with". Documentation indicates to change $suggestAllContent in includes/dbcommon.php from true to false. Well in my version (PHP 5.3) that variable is only located in includes/appsettings.php. See below:



$useAJAX = true;

$suggestAllContent = false;


As you can see I have updated the setting, however the behavior in my app is unchanged. Can someone please point me in the right direction?
Thanks

M
mwelkins author 6/8/2011

Can anyone help? This seems to be such a simple and obvious thing. Surely many people have changed the default behavior of autosuggest?
Thanks,
Michael

Sergey Kornilov admin 6/8/2011

Michael,
thank you for pointing us to this bug. We'll fix it in the next update.
To make your pages working do the following:

  1. Open C:\Program Files\PHPRunner\source\classes\searchclause.php in any text editor, find the line:

    ---------------

    $searchOpt = $suggestAllContent ? "Contains" : "Equal";

    ---------------

    and replace it with this one:

    ----------------

    $searchOpt = $suggestAllContent ? "Contains" : "Starts with";

    ----------------

    Then find this line:

    -----------------

    $this->_where[$this->sessionPrefix."simpleSrchTypeComboOpt"] = "Contains";

    -----------------

    and replace it with this one:

    ------------------

    $this->_where[$this->sessionPrefix."simpleSrchTypeComboOpt"] = $suggestAllContent ? "Contains" : "Start with";

    ------------------

    And add the code:

    ---------------

    global $suggestAllContent;

    ---------------

    just after these lines:

    ---------------

    function parseItegratedRequest()

    {

    ---------------
  2. Open C:\Program Files\PHPRunner\source\searchsuggest.php in any text editor, find and remove the line:

    ----------------

    $suggestAllContent=true;

    ----------------
  3. Run PHPRunner, open your project and make a full build.