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().
| Comment | File | Size | Author |
|---|---|---|---|
| fivestar-5x115-views-tag.patch | 618 bytes | rstaylor |
Comments
Comment #1
sunWorks for me. Probably deserves a new point release.
Comment #2
quicksketchThanks, 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.
Comment #4
gregarios commentedI'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>/voteThe browser hitting this URL is shown this as a web page:
<?xml version="1.0" encoding="UTF-8"?><xml><error>Invalid token</error></xml>Comment #5
Anonymous (not verified) commentedSuddenly 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.
Comment #6
dr.user commented@asennus1
Seems that only voting with javascript disabled is broken.
Comment #7
Anonymous (not verified) commented@dr.user thanks. No issue for us any longer as we upgraded Drupal but I'll leave it as a future refrence.
Comment #8
whiteph commentedWe 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.
Comment #9
whiteph commentedSee Help testing Drupal 6 patches.