Sorry for the repost but I buried my last one in a thread that looked somewhat similar. I do need to resolve this somewhat soon.

I just came on this problem with the upgrade to fivestar 1.15. Previous to that, voting worked through views worked fine (1.14). After the upgrade, voting only works on nodes directly, not exposed through views. In views it sits on "Saving your vote". All relevent modules are at their latest release (voting API and Views)

Any ideas?

Example:
http://www.alanlouie.com/node/4660

Clicking on any stars will be stuck at 'saving your vote'

But if you click into a node (click the title or use the link below), clicking on the fivestar will work fine
http://www.alanlouie.com/node/4656

It doesn't work for either logged in or anonymous users (and the permissions are fine)

I have already deleted the whole directory and unzipped 1.15 into it

More information from watchdog

Message : %message in %file on line %line.

Error: Missing argument 4 for fivestar_vote() in /home/aklouie/alanlouie.com/modules/fivestar/fivestar.module on line 688.

Location: http://www.alanlouie.com/fivestar/vote/node/4650//100?token=9c1b1f95bf2e...

Referer: http://www.alanlouie.com/node/4660

The function in question is this one

function fivestar_vote($type, $cid, $tag, $value) { <-------------- line 688
drupal_set_header("Content-Type: text/xml");
$output = '';
$output .= '<?xml version="1.0" encoding="UTF-8"?>';

// Rebuild the #auto_submit_path that was used as the token seed.
$path = preg_replace('/\/'. $value .'$/', '', $_GET['q']);
if (!isset($_GET['token']) || !fivestar_check_token($_GET['token'], $path)) {
$output .= ''. t('Invalid token') .'';
exit($output);
}

$result = _fivestar_cast_vote($type, $cid, $value, $tag, NULL, TRUE);
votingapi_recalculate_results($type, $cid);

if ($type == 'node') {
$node = node_load($cid);
}
$stars = variable_get('fivestar_stars_'. (!isset($node) ? 'default' : $node->type), 5);
$feedback_enable = variable_get('fivestar_feedback_'. (!isset($node) ? 'default' : $node->type), 1);

$output .= '';

if (count($result)) {
foreach ($result as $data) {
if ($data['tag'] == $tag) {
$output .= '<'. $data['function'] .'>'. $data['value'] .'';
$summary[$data['tag']][$data['function']] = $data['value'];
}
}
}

CommentFileSizeAuthor
#16 457370.patch1.97 KBrobbiethegeek

Comments

laddiebuck’s picture

I came across the exact same issue the very same day (today) as well... For now, I just downgraded to Fivestar 1.14, but I am trying to see if a patch would fix it.

aklouie’s picture

More info. Reverting to 1.14 does not resolve but reversion to 1.13 does. So I assume I upgraded from 1.13 to 1.15 to break it.

luco’s picture

I got a new client and this exact issue - but his is 1.13 . I can't tell if it has been downgraded, but I'll ask him.

I'm also at a loss here.

luco’s picture

in fact, scratch that.

I just tried accessing the node to vote directly. didn't work. now I'm confused.

cbrisighello’s picture

I too have this same problem. So far I could isolate this behaviour:

Views set with View Type other than "Full Node" (ie. Gridview, List) - gives me the "Missing argument 4 for fivestar_vote()"

If my view is set for "full nodes", votes are recorded successfully.

I have a gridview so for the time being I have disabled the 'clickable' setting for its fivestar field.

cbrisighello’s picture

My issue (described in the previous post) is resolved by patch http://drupal.org/node/503142

quicksketch’s picture

Status: Active » Fixed

This should be fixed in the 1.16 version (at least I'm unable to reproduce it now). Please reopen if this problem still exists in this latest version.

marcoBauli’s picture

Version: 6.x-1.15 » 6.x-1.18
Status: Fixed » Active

.. still experiencing this same bug on latest 1.18 version of Fivestar.. :|

the problem seems related to the following:

Row style: Fields
Fields: Vote results: Value

setting Row style: Node everything works fine

i'm working locally at the moment, in case let me know if an export of the view might help

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)

@marcoBauli: Sorry to hear that you're having problems, but I don't understand the problem you're reporting. This issue is about a bug that prevents people from voting. The "Vote results: Value" field isn't intended to let you vote on something. Additionally, with the latest version of Fivestar, I am able to vote on nodes in a view whether they are teasers or full nodes, so this issue appears to be fixed.

Can you please clarify whether your issue is part of the one other people in this thread experienced, and if not, open a new issue for it with a description of the problem and how to replicate it, so that we can look into it?

Thanks!

Brian294’s picture

@ezra-g: here is a way to replicate the problem: http://drupal.org/node/558406

OldAccount’s picture

I have the same issue, using Fivestar 1.18. Votes are saved for the Views block I have on the Home page, but not in the Views block I have on another page.

Both are using the fields Row style. The only difference between the two is the one that doesn't work is using AJAX and the mini pager and the other is not using either. But turning off AJAX and mini pager didn't fix the problem.

dark.o’s picture

same problem here, Error: Missing argument 4 for fivestar_vote() in .../fivestar.module on line 688. I get "saving your vote" untill a page reload, and then the error message is there.

using Fivestar 6.18
Style is "Grid" and Row style is set on "fields", but when set on "node" it works fine. Since I want to allow users voting just on a cck field from a node (not the whole node), showing the whole node in a view doesn´t work for me. I understand than u guys maybe did not think of letting users vote with field Votes:Value, but it appears that some of us would enjoy that. :)

Looking forward to some work around. Have not tested 2.x version of Fivestar yet...

erikjohansson’s picture

Just ran into this same problem, wanting to be able to vote in a view using row style: fields instead of node.

Hoping that it will get fixed in a future version.

dpatte’s picture

I also am seeing the same problem.

Voting works on nodes, but when i include the widget as a field of a table, clicking on any stars will be stuck at 'saving your vote'. When i go elsewhere after that i get the error '"Missing argument 4 for fivestar_vote()'. Is there a way to pass the missing tag into the view?

BTW: and unrelated, but has anyone ever used this module and heard from those being voted that they wanted their (low) results hidden from the public?

dpatte’s picture

I have resolved my issue now. In the relationship definition for node: vote results, I have now selected the filter 'normal vote'. It had been set to 'no filter' before. If anyone can explain these 'data filters' better, it would certinly be helpful.

BTW - thanks for your great module!

robbiethegeek’s picture

StatusFileSize
new1.97 KB

It seems like the issue is that the form['vote'][0]['#auto_submit_path'] was concatenating $settings['tag'] and that could and will be blank at times if you are calling from a form and the default axis is assumed (vote).
Here is a fix to stop this from creating bad paths like /fiverstar/vote/node///

Robbie

andrewlevine’s picture

subscribe

robbiethegeek’s picture

You are relying on $settings['tag'] to make your URL but are checking to see if it is set in the the same array and allowing it to get a dafualt value if it is not set.

function fivestar_custom_widget(&$form_state, $values, $settings) {
//   skipping to the form vote array

  $form['vote'] = array(
    '#type' => 'fivestar',
    '#stars' => $settings['stars'],
    '#vote_count' => $values['count'],
    '#vote_average' => $values['average'],
    '#auto_submit' => isset($settings['autosubmit']) ? $settings['autosubmit'] : TRUE,
    '#auto_submit_path' => (!isset($settings['autosubmit']) || $settings['autosubmit']) ? 'fivestar/vote/'. $settings['content_type'] .'/'. $settings['content_id'] .'/'. $settings['tag'] : NULL,
    '#allow_clear' => $settings['allow_clear'],
    '#content_id' => isset($settings['content_id']) ? $settings['content_id'] : NULL,
    '#required' => isset($settings['required']) ? $settings['required'] : FALSE,
    '#feedback_enable' => isset($settings['feedback_enable']) ? $settings['feedback_enable'] : TRUE,
    '#labels_enable' => isset($settings['labels_enable']) ? $settings['labels_enable'] : TRUE,
    '#labels' => isset($settings['labels']) ? $settings['labels'] : NULL,
    '#tag' => isset($settings['tag']) ? $settings['tag'] : 'vote',


and the theme function theme_fivestar_preview doesn't set the tag in the settings array.

If there are times that $settings['tag'] can be empty my patch resolves when it is empty, if not then all the isset's are not necessary if the entire $settings array are required.

Just a little follow up after the 10 secs we got to talk about it in #drupalnyc :)

Robbie

ezra-g’s picture

Status: Postponed (maintainer needs more info) » Needs review

Marking as NR - thanks.

houen’s picture

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

Subscribe

houen’s picture

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

- Whoops, sorry - didnt see the part where it changes the version for the whole issue. Changed it back again, however, I am getting this issue on 6.19 too

houen’s picture

This: http://drupal.org/node/457370#comment-2170370

Worked for me too - weird, but there it is...

schedal’s picture

Exact same problem, voting fivestar when exposed in a view doesn't work, with error message as above.

Using fivestar version 6.x-1.19

Thanks for any fixes you may be working on.

best, seb.

schedal’s picture

Version: 6.x-1.18 » 6.x-1.19
ndmaque’s picture

#15 dpatte
thanks, it worked for me 6.19

ressa’s picture

Yep, #15 does the trick, using 6.x-1.19.

dlin’s picture

What fixed it for me was actually turning on user permissions to allow anonymous users to vote. Went to /admin/user/permissions under "fivestar" and checked anonymous users box.

boran’s picture

Hi,
Is #16 being committed?
The patch worked fine for me with 6.x-1.19, but I'd prefer to be using an official release :-)

p.brouwers’s picture

I had a similar problem using Fivestar 6.x-1.19

Had a field in views with:
Votes: Value
Relationship: Votes (Node: Votes, percent, normal vote, restricted to current user)
Appearance: Fivestar stars (Clickable, no text)

It would show the field with clickable stars and you could click it, but it would never register your vote because it would try to load the link: fivestar/vote/node/%252Fvote/80?token=1829f02f0cac2cc7339a051ec5bcc05c

After some research I found out it was NECESSARY to add a field node: nid to the view. Then the url became:
fivestar/vote/node/133/vote/80?token=1829f02f0cac2cc7339a051ec5bcc05c

silvio’s picture

subscribe

ratinakage’s picture

#15 worked for me!

Thanks... =)

summit’s picture

#15 worked for me on 6.2.dev also!
Greetings, Martijn

Status: Needs review » Needs work

The last submitted patch, 457370.patch, failed testing.

gluebox’s picture

I did not see a filter for "normal vote" in the relationship of my node:vote as suggested in #15. The patch from #16 cleared my errors. Thanks robbiethegeek.

mr.j’s picture

I am seeing this error in my logs. However it is on a page that is not using fivestar in views. I cannot reproduce it by using the widget but I can if I view the source and browse to the autosubmit path directly i.e from this I navigate to mysite/fivestar/vote/node/271/vote

<input type="hidden" name="auto_submit_path" id="edit-auto-submit-path" value="/fivestar/vote/node/271/vote" class="fivestar-path">

So I assume it some sort of malicious or misconfigured bot that is scanning the html source for file paths.

Anyway the patch in #16 does not fix the problem.

ss81’s picture

Lucience’s picture

#15 worked for me too.

Drupal 6.26
Views 6.x-2.16
Fivestar 6.x-1.20
Voting API 6.x-2.3

Tyvm

dave reid’s picture

Status: Needs work » Fixed

Committed a modified version of #16 to 6.x-1.x: http://drupalcode.org/project/fivestar.git/commit/37f9442

Status: Fixed » Closed (fixed)

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