Closed (fixed)
Project:
Fivestar
Version:
5.x-1.12
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Apr 2008 at 20:55 UTC
Updated:
25 Mar 2010 at 13:27 UTC
In an attempt of creating a "hotornot" kind of website i have installed:
drupal 5.7
fivestar 5.x 1.12
votingapi 5.x-1.5
actions 5.x-2.4
voting actions 5.x-2.0b2
actions with regular trigers works.
fivestar+votingapi works.
but when a voting action is created suddenly fivestar halts on: "Saving your vote...", vote is saved to DB but the voting action don't execute.
ThanX
Comments
Comment #1
gabash commentedIt might be a voting actions issue...
i have played some more with the voting actions and it seems that regular actions such as "save post" are working with fivestar.
what's not working is the advanced actions, in this case "redirect to url ..." which works fine when using regular trigger.
Any idea?
Comment #2
quicksketchA "redirect to url ..." will definitely cause issues with Fivestar's AJAX voting mechanism. Here's what's happening:
What normally happens:
- User clicks on a Fivestar widget to rate.
- AJAX request is made by the current page.
- VotingAPI saves the vote.
- Fivestar generates XML and prints the page.
- The current page receives XML, then updates the voting widget with the new values.
What happens with VotingActions:
- User clicks on a Fivestar widget to rate
- AJAX request is made
- VotingAPI records the vote
- VotingActions hooks in and says "oh I'm redirecting this URL" <-- Where things go wrong
- Instead of returning XML to the calling page (which would update the votes), the original page gets back a full HTML page of wherever VotingActions redirected the page.
- Fivestar doesn't get to generate it's XML, because VotingActions has ended the execution by using a drupal_goto().
So I don't think it's a bug in either VotingActions or Fivestar, it's just a case of using two features in incompatible ways. To make this work, Fivestar would have to *not* be AJAX driven, instead reloading the page to save a vote.
Comment #3
gabash commentedAny way around this? using these modules combined seemed ideal (+imagefieled, view ..).
maybe a different approach to create a drupal hotornot site? i prefer a scalable solution then a custom script. Thanx alot.
Comment #4
quicksketchFivestar provides a nice JavaScript hook that you can use to go to the next page. If you add JavaScript to the page that contains something like this:
Comment #5
quicksketchComment #6
eshaman commentedawesome tip! Exactly what I was looking for :)