after a user submits few scoops he gets this error msg. I've searched this forum and drigg forum, found out that quite a few people have this issue. Also tried all the suggestions like updating drupal or putting few UIDS where it asks in Autovoting fields for a "submit as..." but nothing helped. Any ideas?
thx

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND n.status = 1 AND n.promote=0 AND n.type='drigg' ) ORDER BY vc.value DESC LI' at line 1 query: SELECT * FROM node n LEFT JOIN votingapi_cache vc ON vc.content_id=n.nid LEFT JOIN term_node t ON n.nid = t.nid WHERE ( 1=1 ) AND ( 1 = 1 AND vc.content_type = 'node' AND vc.value_type = 'points' AND vc.tag = 'vote' AND vc.function = 'sum' AND n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) - 60*60*48 AND t.tid= AND n.status = 1 AND n.promote=0 AND n.type='drigg' ) ORDER BY vc.value DESC LIMIT 5 in /home/moksiru/public_html/includes/database.mysql.inc on line 174.

Comments

alliax’s picture

the error is at this point in SQL :
AND t.tid= AND

there should be a value after t.tid =

diesel7’s picture

excuse me for my noobness, but what kind of value and where do I fix this?

alliax’s picture

I'm not saying that I know the answer, I'm just pointing out the exact location of the problem in the error message, for other users more qualified.

diesel7’s picture

thx anyways I'll play around

diesel7’s picture

anybody else? im very puzzled with this, I checked the database.mysql file but could find anything there, Im not a coder ;(

diesel7’s picture

this is my line 174, I still cant figure this out

if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
$queries[] = array($query, $diff);
}

if ($debug) {
print '

query: '. $query .'
error:'. mysql_error($active_db) .'

';
}

if (!mysql_errno($active_db)) {
return $result;
}
else {
trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
return FALSE;
}

alliax’s picture

The error won't be in database.mysql.inc because this file is simply something that executes orders.
The order given has an error (the t.tid= should have a value) and so the problem is about finding who gave the order.
One solution would be to search in files for the "t.tid" string, but then depending on what you find there may or may not be any obvious answer because such an error can happen depending on variables, ie. the same code will sometimes put a value after t.tid = and sometimes not, so the problem will be higher up in the chain, who fills the variables?

See, the problem is not so simple, it depends on the specific circumstances when the error happens.

diesel7’s picture

I see what you're saying. the error happens when a user tries to submit a scoop to a drigg based site. the scoop adds but with an error. and only gets an error when a content with a link is submitted to a one particular category, other categories are ok.

lhahle’s picture

Yes, I received this same error when I decided to change the name of an already existing category and clicked on a submitted article (within the altered category name).

To correct the mistake I simply changed the category of the article and the error went away.

The odd thing is this -- after moving the article back to its original category with the "altered" name -- the error went away!!

Very odd, but such a simple fix!

mercmobily’s picture

Status: Active » Fixed

Hi,

Ah, I think I know what it is. This was fixed in Drigg 6.x -- sorry.
There was a problem when you changed a category name. This is what must have happened...

Sorry people, there is no fix for the 5.x tree... the good news is that the 6.x tree is going to be ready very soon, and we will all be able to switch...

Merc.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.