Once #1198128: Convert fivestar/node_type pairings into fivestar field widgets is committed, there is no longer a need to have custom votingapi views formatters. You can instead use the fivestar fields in views.

Comments

james.elliott’s picture

ericduran’s picture

Status: Needs review » Needs work
StatusFileSize
new5.77 KB

Here's a re-rolled of this patch. But I don't think this patch is ever going to get in like this.

We can't just remove the votingapi hooks because they provide a little more than stars display. Right now the fields work as you would expected them to work, but all the logic is done on the rendering of the widget.

If we apply this patch, we loose the option of doing relationships with the votingapi results. This will not allow people to do something like Top rated content. We'll they'll be able to do top rated content they just wont be able to display them as stars.

So this issue should be Clean up votingapi hooks, because it's still relying on all the old content type settings stuff.

ericduran’s picture

Priority: Normal » Major
ericduran’s picture

Title: Remove custom views formatters » Fix custom views formatters
Category: task » bug
ericduran’s picture

Just bumping this issue for my self. This will ideally be the next patch to get in.

Also note the above patch just remove the support. This is not a viable solution because we still needs the stars to be a widget when display voting api data such as Top rated content, etc.

rodrigoaguilera’s picture

well, subscribe to this issue then

brunorios1’s picture

subscribing

jabbamonkey’s picture

subscribing...

BeaPower’s picture

Also bring back the ability to change colors.

tneo’s picture

And how do I get my own widget instead of stars, will that be fixed by this commit?

daglees’s picture

What's the proposed solution? We may be able to help if we know what direction you want this to take.

ann_meredith’s picture

sub

ericduran’s picture

@BeaPower, that feature was remove on purpose.

@tneo, You can declare your own widget using hook_fivestar_widgets.

@Daglees, I don't quiet have a proposed solution just yet.

SNaKeMe’s picture

Can't change the style of fivestar on my panel site.

Get an AJAX Error:
Fatal error: Unsupported operand types in /sites/all/modules/fivestar/includes/fivestar.field.inc on line 353

I think it's the same error you have in views just in panels.

Sub.

ericduran’s picture

This commit -- http://drupal.org/commitlog/commit/2490/d8d5c086f0c75ecc743f07a2e1be7a0a...

Removed the views support for now. Until we have a fix in place. I'm doing this to prevent users from trying to use the non-workings views formatter.

Please don't comment on this issue asking for views support. We will add it back.

tneo’s picture

Thanks Eric, found where to change it. :-)

Canadaka’s picture

subscribe

ericduran’s picture

Ok, so I though of this for a while.

I think the best option is to drop the custom views formatters. We should remove all the custom views_formatter code out of the fivestar module.

You really don't need the custom formatters anymore because you could just select the field for display. The only thing you needs is the voting api relationships to do the sorts which you still have available to you.

So essentially strip all the functionality and this should be good to go.

ericduran’s picture

It looks like @james.elliott was a month ahead of me. ;)

ericduran’s picture

Title: Fix custom views formatters » Remove custom views formatters
ericduran’s picture

Status: Needs work » Fixed
Canadaka’s picture

I just installed the newest DEV and I can still add my fivestar "field_rating" as a field and it produces the JS error here: http://drupal.org/node/1268972

So how can I go about showing a nodes current rating represented by stars in a view?

ericduran’s picture

@Canadaka is not instance. It takes time for the new file to be available with the changes.

I'll have a look at the other issue and report back there.

rodrigoaguilera’s picture

The example view should be updated to make an example on how to show the stars in wiews ¿Am I right?

ericduran’s picture

@rodrigoaguilera We don't provide an example views. I'll create a patch for votingapi to remove there fivestar example.

Canadaka’s picture

Its working now in views! Sometimes when before the view is saved the widget selection contains no images though, just the text representation

Cancel rating
Give it 1/5
Give it 2/5
Give it 3/5
Give it 4/5
Give it 5/5

But when I save view seems to be all good.

brunorios1’s picture

but is possible to configure the display options of the widget using the field?
i.e.: i want to choose the stars style, show stars only without the vote feature and without the text...

thanks!

Canadaka’s picture

yes you can do all of that in the field settings in views. But you have to do it for each view, would be nice if one could set a site-wide default widget selection.

ericduran’s picture

@brunorios1 Yes its possible, just unchecked the exposed this widget checkbox.

ericduran’s picture

@Canadaka, glad is all working now.

Status: Fixed » Closed (fixed)

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

marcoka’s picture

it is pretty nice cleaning things up. the problem with this it that if you upate now, your site will be broken because now formatters are missing. also ratings in blocks will not appear anymore.