Looking at the code it does not function as I would expect.

Starting with rate_vote_ahah() I would expect this block of code to handle saving the vote:

  // Process arbitrary value, used for sliders.
  if (isset($_GET['value']) && $widget->value_type == 'percent') {
    // Validate the token against the general widget token (found in the widget classes).
    $id = "rate-$widget_id-$content_type-$content_id";
    $token = _rate_get_token($id);
    $value = (int) $_GET['value'];

    if (isset($_GET['token']) && $_GET['token'] == $token && $value >= 0 && $value <= 100) {
      rate_save_vote($widget, $content_type, $content_id, $value, TRUE);
    }
  }

but instead for the widget instance that works, it saves through the option loop. While the widget processing does go through the block of code as expected it never saves because the tokens do not match. I suspect this is do to this logic in slider.js.

            stop: function(event,ui) {
              data.value = ui.value;
              var itemid = "#rate-button-" + Math.round(data.value / 10);
              var token = $(itemid).attr('href').match(/rate\=([a-zA-Z0-9\-_]{32,64})/)[1];
              return Drupal.rateVote(widget, data, token);
            }

where itemid is not dependent on the widget being used but the value set and the resulting token is based not on the rate id but on the option id. So this code does not appear to allow for multiple sliders on one page.

Back to rate_vote_ahah() and the code above, the code in the block above generates the token based on rate id ("rate-$widget_id-$content_type-$content_id") which would allow multiple sliders on a page but will not match the token passed in slider.js.

Logically it would make sense to store tokens not as attributes to html elements but as Drupal.settings based on $widget_id, $content_type and $content_id.

Comments

foagth’s picture

did you or anyone else ever had any updates about this one?

HansKuiters’s picture

I can confirm the problem. Only the top placed, secondly added, slider works. The first added slider worked fine till I added the second slider.

el_pirata’s picture

I'm trying to display three slider widgets per front page and can only view 2. The third doesn't display or at best, displays partial rendering.
Is there any workaround for this issue?
HELP!

Thanks.

avonis’s picture

+1 Same problem here. If you put more than one slider on a node only the first slider will work!