Hi everyone
I'm running a site with 2.4.0 and have enabled fulltext search. I'm doing a little statistics on the searches by writing the search query into a dataobject and save it to the database for each search a user makes. The code looks like this and is placed inside the results-function in my Page_Controller.php class:
/**
* Process and render search results.
*
* @param array $data The raw request data submitted by user
* @param SearchForm $form The form instance that was submitted
* @param SS_HTTPRequest $request Request generated for this action
*/
function results($data, $form, $request) {
$Search = new SearchEntry();
$Search->SearchQuery = $form->getSearchQuery();
$Search->write();
$data = array(
'Results' => $form->getResults(),
'Query' => $form->getSearchQuery(),
'Title' => 'Search Results'
);
return $this->owner->customise($data)->renderWith(array('Page_results', 'Page'));
}
What bugs me is that my SearchEntry dataobject gets written twice on my live site, but not on my localsite. Does anyone have any idea what could be causing this?
Thanks for any help
Joel