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

mean0dspt’s picture

also, I've found the same issue at drigg-code
http://www.drigg-code.org/node/724
dated February 18th, 2009

mean0dspt’s picture

ok, so I've localized the problem down to User Karma settings. If I disable User Karma, the anonymous posts get through.

mercmobily’s picture

Project: Drigg » User Karma

Hi,

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.

mean0dspt’s picture

I'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:

warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/infuzor/www/publica.by/includes/database.inc on line 241.
warning: implode() [function.implode]: Invalid arguments passed in /home/infuzor/www/publica.by/includes/database.inc on line 241.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/infuzor/www/publica.by/modules/user/user.module on line 502.
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 ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/infuzor/www/publica.by/modules/user/user.module on line 502.
warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/infuzor/www/publica.by/includes/database.inc on line 241.
warning: implode() [function.implode]: Invalid arguments passed in /home/infuzor/www/publica.by/includes/database.inc on line 241.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/infuzor/www/publica.by/modules/user/user.module on line 502.
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 ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/infuzor/www/publica.by/modules/user/user.module on line 502.
mercmobily’s picture

Hi,

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.

mercmobily’s picture

Hi,

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.

mercmobily’s picture

Status: Active » Fixed

Hi,

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.

mercmobily’s picture

Status: Fixed » Closed (fixed)
rooby’s picture

FYI,
You can get this error if you use devel generate for content.