Closed (fixed)
Project:
User Karma
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 May 2009 at 10:18 UTC
Updated:
1 Feb 2010 at 10:34 UTC
I recieve following error notice when anonymous user submits scoop:
Fatal error: Unsupported operand types in /home/infuzor/www/ba/sites/all/modules/votingapi/votingapi.module on line 519
Voting API 6.x-2.0-rc2
despite the error, the scoop submits and can be seen in the list after page refresh
lines from 500 to 525
db_query($query, $details['args']);
}
/**
* Internal helper function constructs WHERE clauses. Don't use unless you're me.
*/
function _votingapi_query($table = 'vote', $criteria = array(), $alias = 'v.') {
$criteria += array(
'vote_id' => NULL,
'vote_cache_id' => NULL,
'content_id' => NULL,
'content_type' => NULL,
'value_type' => NULL,
'value' => NULL,
'tag' => NULL,
'uid' => NULL,
'timestamp' => NULL,
'vote_source' => NULL,
'function' => NULL,
);
$query = '';
$args = array();
if (!empty($criteria['vote_id'])) {
_votingapi_query_builder($alias . 'vote_id', $criteria['vote_id'], $query, $args);
}
Comments
Comment #1
mean0dspt commentedalso, I've found the same issue at drigg-code
http://www.drigg-code.org/node/724
dated February 18th, 2009
Comment #2
mean0dspt commentedok, so I've localized the problem down to User Karma settings. If I disable User Karma, the anonymous posts get through.
Comment #3
mercmobily commentedHi,
Great. I am working on User Karma right now, so that's good timing.
Can you tell me exactly how to create an environment that reproduces this problem?
Changing this to User Karma...
Thanks,
Merc.
Comment #4
mean0dspt commentedI'm afraid the amount of settings that might be (and might be not) responcible for this is too big.
in the nutshell, this happens when I activate "on posting" karma method, and anonymous posting is enabled.
also, I'm not sure what I did, but now I recieve following error when viewing /karma_users page:
Comment #5
mercmobily commentedHi,
OK, I am gonna ignore what you wrote after "also, I'm not sure what I did, but now I recieve following error when viewing /karma_users page:" -- please keep issues tidy, one problem per issue, and please submit a new bug for the other issue with a clear way of reproducing it from a fresh install.
Merc.
Comment #6
mercmobily commentedHi,
OUCH.
DOUBLE OUCH.
I've just reproduced this. My god... will I ever apologise enough?
Trying to fix it now. User Karma is part of a Google Summer of Code project... which is why I am fixing it up on a Saturday night 9:13 ...
Merc.
Comment #7
mercmobily commentedHi,
Fixed. user_karma_calculate_karma($uid) was doing things even if uid==0, whereas we all know that karma for anonymous users doesn't make sense!
I am still puzzled on WHY you would get that error... but it doesn't really concern us at all.
Bye!
Merc.
Comment #8
mercmobily commentedComment #9
rooby commentedFYI,
You can get this error if you use devel generate for content.