After upgrading to 1.15, voting from a view gives an error message on the next pageload:
warning: Missing argument 4 for fivestar_vote() in sites/all/modules/fivestar/fivestar.module on line 645.
'function' => 'fivestar_vote', 'args' => array ( 0 => 'node', 1 => '94', 2 => '20', )

It's getting passed type, nid, value. But it also expects a $tag variable: fivestar_vote($type, $cid, $tag, $value)

fivestar_custom_widget() sets the path to 'fivestar/vote/'. $settings['content_type'] .'/'. $settings['content_id'] .'/'. $settings['tag']
but fivestar_views_widget_handler() does not set $settings['tag'], so it's blank and the value falls into its position in the URL.

Patch attached sets $settings['tag'] to 'vote' as it is in fivestar_form().

Note:
Similar issue in 6.x-1.15 at http://drupal.org/node/457370 may be due to lack of a default value when $tag is empty in fivestar_views_widget_handler().

CommentFileSizeAuthor
fivestar-5x115-views-tag.patch618 bytesrstaylor

Comments

sun’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. Probably deserves a new point release.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed to 5.x branch. This issue doesn't look like it's applicable to the Drupal 6 version, since it's already setting the tag within views.

Status: Fixed » Closed (fixed)

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

gregarios’s picture

Title: warning: Missing argument 4 for fivestar_vote() in sites/all/modules/fivestar/fivestar.module on line 645. » warning: Missing argument 4 for fivestar_vote() in sites/all/modules/fivestar/fivestar.module on line 688.
Version: 5.x-1.15 » 6.x-1.19
Status: Closed (fixed) » Active

I'm getting this a lot (as a standard error - not labeled warning) with D6.25 and Fivestar 6.x-1.19:
Missing argument 4 for fivestar_vote() in /sites/all/modules/fivestar/fivestar.module on line 688.

The error appears in my server logs if anyone simply goes to this type of URL:
http://website.com/fivestar/vote/node/<nodenumber>/vote

The browser hitting this URL is shown this as a web page:
<?xml version="1.0" encoding="UTF-8"?><xml><error>Invalid token</error></xml>

Anonymous’s picture

Version: 6.x-1.19 » 6.x-1.20

Suddenly the log fills with this, nothing has been changed:

fivestar/vote/node/5151/vote, /fivestar/vote/node/4821/vote etc.

Missing argument 4 for fivestar_vote() tiedostossa /sites/all/modules/fivestar/fivestar.module rivillä 688.

dr.user’s picture

@asennus1
Seems that only voting with javascript disabled is broken.

Anonymous’s picture

@dr.user thanks. No issue for us any longer as we upgraded Drupal but I'll leave it as a future refrence.

whiteph’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

We can no longer support the Drupal 6 version of Fivestar. It is in security maintenance mode only. When the Drupal 8 version of Fivestar is released, the Drupal 6 version will be officially deprecated.

whiteph’s picture