I honestly don't like php in databases also it makes for crappy deployment.
I say replace it with a better implementation maybe a hook_fivestar_field_targets
Also we can provide some nice defaults like we already do with the comments.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | target.patch | 10.24 KB | ericduran |
| #11 | target.patch | 10.87 KB | ericduran |
| #10 | target.patch | 10.87 KB | ericduran |
| #8 | 0004-Issue-1173814-Replace-php-target-selection-with-some.patch | 10.85 KB | james.elliott |
| #7 | 0002-Issue-1173814-by-ericduran-james.elliott-Changed-Rep.patch | 9.09 KB | james.elliott |
Comments
Comment #1
ericduran commentedThis is killing me, trying to come up with a good solutions.
This isn't by any means complete but uploading this patch here so I wont loose it.
Comment #2
ericduran commentedchx mention adding support for http://drupal.org/project/relation
Comment #3
james.elliott commentedThe problem I'm running into when trying to solve this issue is that different entities have different primary keys to identify them. If you are rating a user you need $entity->uid and if you are rating a node you need $entity->nid and if you are rating a file you need $entity->fid, etc.
This is currently blocking my progress with #1198128: Convert fivestar/node_type pairings into fivestar field widgets
Comment #4
james.elliott commentedThis may not be something better for target selection. However, what it does is to make fivestar fields default to voting on the entity to which they are attached.
It also allows you to vote on entities that are not nodes. Which I suppose is an improvement. So perhaps better target selection does apply.
Comment #5
james.elliott commentedI took a closer look at your first patch here, and I agree that it is the way to go. I rerolled your patch with some tweaks. It appears to work beautifully. But it revealed to me another issue.
I think that perhaps the voting target should be instance specific. This is due to the fact that the same field can be attached to multiple instances.
Here is the scenario:
I would expect that setting a vote in either location would cast a vote on the node. However, because the target is field and not instance specific, what I've done in step 2 is to retarget the comment votes at "Self".
I think that the best solution would be to change the voting target to be an instance setting in #1198128: Convert fivestar/node_type pairings into fivestar field widgets
Comment #6
ericduran commentedHey James,
You are right, the voting target should be instance specific. We should turn that into it's own little patch that can be the 1st in our serious of patches.
I know is a hassle to separate them out. But this is the easiest way to make sure we don't break any functionality as we start migrating to fields.
Once we have the target option on the instance settings, we can work on this issue, then we can apply the access changes and last but not least we can move the fivestar_voting to field settings.
I know this seems like a hassle but at the same time we can't break fivestar between branches.
Again, Thanks so much for all your work on this.
Comment #7
james.elliott commentedI took your advice and have created separate patches that followed your order of updates.
The patch for this issue does the following:
Comment #8
james.elliott commentedLatest patch is attached
Comment #9
ericduran commentedNext patch to go in..... Working on this now.
Comment #10
ericduran commentedPatch above no longer applies.
Re-rolled. Attached, also this needs work, the target is only allowed to be a int, yet we're setting 'text' of self, so it throws a db exception
Comment #11
ericduran commentedPatch above no longer applies.
Re-rolled. Attached, also this needs work, the target is only allowed to be a int, yet we're setting 'text' of self, so it throws a db exception
Comment #12
ericduran commentedHere's an updated patch.
I removed the fivestar_update_7003 update because not every option with a target needs to be self. This will be more clear when we separate the widgets out.
But the target is only needed when voting with voting api. If you're using the fivestar widget only as a cck field you don't need any of that. It'll be a lot simple to differentiate between both use case once we separate out the fields which I'm hoping to get through today
Comment #13
ericduran commentedForgot the patch.
Comment #14
ericduran commentedTrying to tackle all these patches so we can clean up the two widgets.
--
http://drupalcode.org/project/fivestar.git/commit/8e265f6e7f82737f36cad1...