Closed (fixed)
Project:
Zeitgeist
Version:
master
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
8 May 2006 at 19:52 UTC
Updated:
14 Jul 2006 at 15:15 UTC
If you open the searchpage (/search/node) an entry is added to the database in zeitgeist, with an empty search entry...
the quickest fix I can think of is modifying the store search function as follows:
function _zeitgeist_store_search($search, $category, $ts = NULL)
{
if (!isset($ts)) {
$ts = time();
}
if (isset($search)) {
$sq = 'INSERT INTO ' . ZGTABLE . ' (search, category, ts) '
. "VALUES ('%s', '%s', %d) ";
db_query($sq, $search, $category, $ts);
}
}
Comments
Comment #1
jadwigo commentedThis would actually be better, it saves one function call
Comment #2
fgmYour second patch suggestion indeed removes such logging rather efficiently.
However, the problem is that it is important that ZG actually store empty searches, and I'm not sure how the module can know whether someone sent an empty search request, or just went to the search page without the intent to submit a search: both use the same mechanism currently, AFAIK.
Do you think you can imagine a way to get the difference between these two cases ? This is related to my battle plan for the next major Drupal version, and specifically the details outlined about logging for drupal (temporary URL, sorry).
Comment #3
jadwigo commentedIn search module the following function is called and triggers an error when an empty search is submitted, I guess you could intercept the
$form_values['processed_keys'];too in zeitgeist.Comment #4
fgmThis issue was actually covering two distinct cases:
Version 1.9.2.1 now in CVS adds a setting to allows ZG to keep valid empty searches or not, and should no longer store invalid empty searches.
Comment #5
jadwigo commentedEverything seems to work as advertised, code looks pretty .... it's all good.
Comment #6
fgmOK, then...
Comment #7
(not verified) commented