Problem/Motivation

When you have fivestar on a comment and you have comment approval needed then your rating isn't added to the votingapi instantly. Because only the vote and the uid are stored in the fivestar field settings the IP-address is never stored. When you approve the comment later on then a whole lot of strange things happen in the votingapi module. Because voting api doesn't know the ip-address it doesn't set the window here:

function votingapi_select_votes($criteria = array(), $limit = 0) {
  $window = -1;
  if (empty($criteria['uid']) || $criteria['uid'] == 0) {
    if (!empty($criteria['vote_source'])) {
      $window = variable_get('votingapi_anonymous_window', 86400);
    }
  } else {
    $window = variable_get('votingapi_user_window', -1);
  }
  if ($window >= 0) {
    $criteria['timestamp'] = REQUEST_TIME - $window;
  }
  $function = variable_get('votingapi_storage_module', 'votingapi') . '_votingapi_storage_select_votes';
  return $function($criteria, $limit);
}

And therefore all votes on the samen node of users with uid 0 (anonymous user) get removed upon accepting a comment of an anonymous user.

Proposed resolution

Store the ip-address of the anonymous user in the field table.

Comments

Johnny vd Laar created an issue.