As far as I understand, now it's impossible to select user object as target for voting in fivestar widget field settings.

(I've checked fivestar_fivestar_target_info() and it's just nodereferences)
is it a problem with 2.x branch to implement user support? do you have plans to implement this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericduran’s picture

Category: task » feature

No problem, just didn't write it. If someone wants to write it all patches are welcome.

ericduran’s picture

Priority: Normal » Minor
restyler’s picture

Status: Active » Needs review
FileSize
2.2 KB

Here is the patch:

restyler’s picture

(against alpha1)

ericduran’s picture

Status: Needs review » Needs work

@restyler Awesome.

A couple of comments:

+++ fivestar/fivestar.module	2011-10-20 18:41:56.000000000 +0200
@@ -737,6 +737,23 @@ function fivestar_fivestar_target_info($
+  ¶
+  // Add user reference support

Those extra white spaces should be removed

+++ fivestar/fivestar.module	2011-10-20 18:41:56.000000000 +0200
@@ -737,6 +737,23 @@ function fivestar_fivestar_target_info($
+  if (module_exists('user_reference')) {

We can avoid the if (module_exists(...)). I'm thinking we set up a fivestar.targets.inc

file and in there we can declare each module as a separate hook such as user_reference_fivestar_target_info() and node_reference_fivestar_target_info()

that way those options are only available when the modules exists and also every module get implemented correctly. :)

It'll also allow us to to a user_fivestar_target_info so we can target the Node Author, etc..

Thought? I think this would be better for the long run so we can start separating out the code. But besides that everything else looks Great.

restyler’s picture

I agree, the hook approach should work fine here.

Shadlington’s picture

#3 works for me :)

Shadlington’s picture

-Deleted-

ericduran’s picture

Priority: Minor » Normal
Status: Needs work » Needs review

Just making sure test pass. It should since most of this functionality isn't tested.

segi’s picture

FileSize
2.16 KB

It works me too. I resubmit the patch with some minor coding standard fixing. I hope it will be the part of module, because it is waiting for a while.

whiteph’s picture

Issue summary: View changes
Status: Needs review » Fixed

Thanks everyone :)

Status: Fixed » Closed (fixed)

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