I am working on a project that aggregates several pieces of contextual information using Panels (3.x). Using the node id as an URL argument, panels loads the appropriate node body, attachments, comments, blocks, and user information into a single page. However, I appear to have an issue: 1. embedding the out-of-box fivestar block, and 2. a promising Views 2 workaround.
1. Fivestar Block
It appears the block that comes with this module is not compatible with Panels. I can embed that block within Panels, but when viewing the rendered page, it's just an empty whitespace.
2. View 2 Work around
I got sneaky and built a View that A) accepts a node id as a parameter, B) creates a relationship with the node: vote results, C) Displays the result as an unformatted field. D) Renders fivestar using the "clickable, with text" appearance.
I go back to my panel, configure it to use this view and it works!!! Sort of... it displays my fivestar in panels, BUT I cannot vote. It's interactive and let's me *try* to vote, but it perpetually says, "Saving your vote..." and when I click out of that page I get this error:
warning: Missing argument 4 for fivestar_vote() in /hsphere/local/home/yadadrop/yadadrop.com/sites/all/modules/fivestar/fivestar.module on line 688.
Summary:
If I am going about putting fivestar into Panels the wrong way, I would appreciate some guidance. However, if fivestar (clickable, with text) is not presently compatible with Panels and/or Views, I am placing my vote to add this feature.
Peace,
Brian
Comment | File | Size | Author |
---|---|---|---|
#1 | fivestar.jpg | 154.19 KB | Brian294 |
Comments
Comment #1
Brian294 CreditAttribution: Brian294 commentedAn export of my view for a "Screencast" node type. Screenshot attached too.
Comment #2
dddave CreditAttribution: dddave commentedThere is definitely an issue with panels. Overriding the nodetemplate with panels still works when the node has a fivestar widget attached but I cannot get it to show in the panel display. All the rest of the node is displayed properly only the fivestar stuff is "stripped".
My uneducated guess would be that this is some issue that has to be solved within panels. I raise the prority to catch the attention of someone deeper knowledge. Maybe this issue has to be moved into the panels queue......
Comment #3
cgjohnson CreditAttribution: cgjohnson commentedWe have the same issue - any updates? thanks.
Comment #4
mukhsim CreditAttribution: mukhsim commentedSubscribe.
Comment #5
ratebz CreditAttribution: ratebz commentedComment #6
jimbojingers CreditAttribution: jimbojingers commentedSame problem here - Missing argument 4 for fivestar_vote()
Managed to work around it by overriding a field template in views.
<?php print drupal_get_form('fivestar_form_node_'. $output, 'node', $output);?>
Comment #7
Exploratus CreditAttribution: Exploratus commentedThanks. That worked!!! Any clues when this will be fixed?
Comment #8
sirkitree CreditAttribution: sirkitree commentedI'm using 1.19 and this seems to work just fine there. Marking as fixed. Someone please reopen if you're still experiencing problems.
Comment #9
apes132 CreditAttribution: apes132 commentedI'm having the same issue as others(1.19): warning: Missing argument 4 for fivestar_vote(). tried doing as #6 said but it didn't seem to work. But I wasn't sure exactly where in my template to put the new php file. I just put it in my main theme folder.
Comment #10
lpalgarvio CreditAttribution: lpalgarvio commentedhey
having the same issue, but also with the view itself.
if you create a view with a page, such as /node/%/rate
then add:
weather or not you add Votes + Voting results or just Votes or Voting results, the behavior is always the same:
it's clickable, but doesn't saves the result.
instead the URL changes to something like /node/77/rate#60
where #60 is the vote you casted.
it never saves.
neither as a View page, nor as a Panel Context.
on the other hand,
with flags, it does work, in both Views and Panels with Views (context), when having arguments in the View (nid) and even when mixed with Fivestars.
Comment #11
lpalgarvio CreditAttribution: lpalgarvio commenteddumping the export of my view bellow.
it has the defaults, 3 context pages for use in Panels and a page for testing Fivestar and Flags.
among the fields, there's product info (ubercart), 1 product image (imagefield), title, body, fivestars and flags.
the intention was to create 3 views to use in panels (left side, right side and footer), each with some content.
sure i could do this with Display Suite, but it doesn't support Flags and has a fixed layout...
Comment #12
apes132 CreditAttribution: apes132 commentedLPCA explains the problem much better than me. "add Votes + Voting results or just Votes or Voting results, the behavior is always the same:
it's clickable, but doesn't saves the result." this is the same exact problem I'm having. Thanks for the thorough explanation of the issue. I hope there is an easy fix for this
Comment #13
tallsimon CreditAttribution: tallsimon commentedI am looking for this functionality too!
Comment #14
jonjon CreditAttribution: jonjon commentedSame issue here: votes are not saved + missing argument error.
Comment #15
EvanDonovan CreditAttribution: EvanDonovan commentedHere's the behavior I have noted, on 6.x-1.19. I have a view embedded in a content pane. The view works to save votes when I have the following settings:
Relationship:
Node: Vote Results (not required)
Filters:Percent, Normal vote, Average vote
Field:
Vote results: Value
Appearance: Fivestar Stars (clickable, with text)
Relationship: Vote results
Label: Rate this video
However, if I use the Node: Votes relationship, and, I believe, either filter it down to the current user or leave it at all users, then the message will *say* that the vote is being saved, but it is actually not saved at all.
I can use the Node: Vote Results relationship, but I would really like to use the "smart stars" (the ones that show either the average or the current user's vote), since that is the client's expectation (and a logical one, I would think).
I can provide an export of the view if necessary, but I will pastebin it rather than adding to the length of this issue.
I am going to try the workaround of #6 to see if it solves my issue for now, since I am desperate (deadline).
(Deleted a few tags on the issue for relevance.)
Comment #16
EvanDonovan CreditAttribution: EvanDonovan commentedThe fix from #6 worked, as I expected it would (the markup it generates is horrendous, but seemingly the same as the markup for the "smart stars" on a node display).
I think that fix could probably be bundled into a field plugin for views, as a stopgap fix, although it would be great to get to the root cause of the issue.
(I just double-checked Dblog - this is "Missing argument 4 for fivestar_vote()" in my case, also. I will try to do some more digging when I am not facing a deadline.)
Comment #17
tingdongc CreditAttribution: tingdongc commentedsame issue, on 6.x-1.19. Votes still not saved.
tried to apply #6 above, it gives a lot of errors like below, looks like a viewed $output. Any ideas?
- Select-ratingPoorOkayGoodGreatAwesome -Your-rating:-4-(4-votes)
">
- Select-ratingPoorOkayGoodGreatAwesome -Your-rating:-4-(4-votes)
-form-token" value="4b2c77abed38233861aaadf0fce1695e" />
- Select-ratingPoorOkayGoodGreatAwesome -Your-rating:-4-(4-votes)
" value="fivestar_form_node_ ...
Comment #18
robcarrSolution at #6 works for me. Using Views 6.x-2.12 and Drupal 6.20. Cheers @jimbojingers
Comment #19
abhid90210 CreditAttribution: abhid90210 commentedI had exactly the same prob. Widget stuck at saving your vote in a view.
Fixed it by giving all three values in Node: Vote relationships ::
Value type:
Vote tag:
Aggregation function:
i.e., don't leave any to default.
Worked!
:)
Comment #20
Summit CreditAttribution: Summit commentedHi,
#6 http://drupal.org/node/558406#comment-2319358 did the trick to get votes showing up in the results!
Does it need to be used like that, or is there also a patch somewhere?
I use fivestar within views/within panels.
Greetings, Martijn
Comment #21
whiteph CreditAttribution: 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 #22
whiteph CreditAttribution: whiteph commentedSee Help testing Drupal 6 patches.
Comment #23
koppie CreditAttribution: koppie commented#19 worked for me! Doesn't involve messy tipple fips. ;-)