Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Current system allows for voting on your own content. I had a request to disable this and I'm sure others have had the same. Here is a patch based on the current version to put an option in the Advanced Settings section to disable this.
Comment | File | Size | Author |
---|---|---|---|
#45 | disallow-vote-own-content-554360-45.patch | 2.51 KB | soulfroys |
#26 | vote_up_down2127.patch | 2.93 KB | Oleksa-1 |
#20 | vote_up_down220310.patch | 2.7 KB | Oleksa-1 |
#12 | vote_up_down1921.patch | 2.4 KB | Oleksa-1 |
#10 | vud.module.zip | 2.56 KB | Oleksa-1 |
Comments
Comment #1
Gekiboy CreditAttribution: Gekiboy commentedThe patch also involves a previous patch I did to remove some defunct and no longer utilized code from this module. I would separate the patch out, but I don't want to toy with the contents of the patch file.
Comment #2
lut4rp CreditAttribution: lut4rp commentedNo more features are being added to 1.x
Needs re-roll for 2.x
Comment #3
Gekiboy CreditAttribution: Gekiboy commentedThis patch was for the 6-2.x branch. Does it not patch correctly?
Comment #4
Gekiboy CreditAttribution: Gekiboy commentedNm, my mistake, this is using 6-1.x. I'll wait until 6-2.x has a stable release before doing anything.
Comment #5
drupov CreditAttribution: drupov commentedsubscribe
Comment #6
drupov CreditAttribution: drupov commented@Gekiboy: Hi, do you have any plans on making this work for the 6.x-2.x version? Thanks!
Edit: sorry, forget this post, I thought the 2.x version had the beta release, but it is not appendable to the latest beta6 release.
Comment #7
ManyNancy CreditAttribution: ManyNancy commentedIs this patch already part of 2.x? I can't vote on my own content.
Comment #8
ManyNancy CreditAttribution: ManyNancy commentedUh nevermind, I had userpoint karma enabled, which has this feature.
I suggest everyone who needs this feature to install that module.
Comment #9
Oleksa-1 CreditAttribution: Oleksa-1 commented@Minqensan thx for idea. I do not use "userpoint karma" but applied its code for vud.module.
Just replace vud.module file with attached file.
How it works see picture attached.
Comment #10
Oleksa-1 CreditAttribution: Oleksa-1 commentedthis one is better )
Comment #11
drupov CreditAttribution: drupov commentedI can confirm that #10 is working for me. I use the latest 2.x-dev version and apply replace the "vud.module" file inside it with the one provided by Oleksa.
@Minqensan: Thanks for the idea!!! The community has been waiting for ages for a solution to not be able to vote on own contents.
@Oleksa: Thanks for adding this feature directly to vud! It's always better to have such a functionality directly in the module itself. Can you please still provide the solution as a patch or specify which rows have been affected by the change? Thanks!!!
Comment #12
Oleksa-1 CreditAttribution: Oleksa-1 commented@mitkoru please try this patch
Comment #13
drupov CreditAttribution: drupov commentedI can confirm that patch from #12 is working!
Thanks Oleksa!
Comment #14
azwildcat CreditAttribution: azwildcat commentedThis is a nice patch. There’s a problem however, in that my anonymous users cannot vote now. I made sure this wasn’t a permissions issue and sure enough anonymous users are allowed to use the module. I then placed the original vud.module back in the folder and it allowed anonymous users to use the module. As such, there’s an issue with this patch. If you can provide a solution, I’d appreciate it.
Comment #15
Oleksa-1 CreditAttribution: Oleksa-1 commentedpls remove this lines from the patch from #12
+ if (!$user->uid) {
+ // Anonymous users can't do karma
+ exit();
+ }
+
Comment #16
marvil07 CreditAttribution: marvil07 commentedmarking as active as it was not applied on CVS
Comment #17
gausarts CreditAttribution: gausarts commentedSubscribing. Thanks
Comment #18
Alcaparra CreditAttribution: Alcaparra commentedI have the last version 6.x-2.x-dev 2010-Mar-12 and I want to disallow Voting on Your Own Content. How to? thanks
Comment #19
marvil07 CreditAttribution: marvil07 commentedpatch in #12 do not apply against 2.x
Oleksa, It would be great if you can re-roll the patch
Comment #20
Oleksa-1 CreditAttribution: Oleksa-1 commentedre-roll
user can't vote with this patch for own content - but if he tries this message popups
Not sure problem with this patch or with new ctools integration?
Comment #21
marvil07 CreditAttribution: marvil07 commentedIt would be great to have a configuration option to choose whether or not we wan to allow users to vote on his own content.
PS: writing it to avoid forgetting it ;-)
Comment #22
Oleksa-1 CreditAttribution: Oleksa-1 commentedIt is already included in this patch http://drupal.org/files/issues/vud_own_content.JPG
Comment #23
drupov CreditAttribution: drupov commentedBut is it already commited to the latest dev? This is a kind of important feature, isn't it?
Comment #24
dmgorsky CreditAttribution: dmgorsky commentedVery important feature!
Comment #25
walker2238 CreditAttribution: walker2238 commentedSubscribing
Comment #26
Oleksa-1 CreditAttribution: Oleksa-1 commentedactually this is code from userpoint karma applied to vud module
Comment #27
marvil07 CreditAttribution: marvil07 commentedIMHO we do not need to define this as a constant.
Here we need to change the logic, since it's implemented on vud module, so we need to be agnostic about what vud_* submodule we are in for voting.
I'm still not sure about how to deal with this, but definitely, we want to avoid assuming all possible submodule cases(BTW this logic do not include support for terms).
Powered by Dreditor.
Comment #28
marvil07 CreditAttribution: marvil07 commentedComment #29
Oleksa-1 CreditAttribution: Oleksa-1 commentedI use this code on big comunity site already during half a year, without any problems. So it is tested very well.
Comment #30
marvil07 CreditAttribution: marvil07 commentedOleksa: please re-read my comment. I'm talking from an architecture perspective, and IMHO it's unacceptable to assume the base vud module knows all its children vud_* submodules(it is not related with the efficacy of the patch, it solves the problem, but I think it's a bad architecture choice)
Comment #31
Oleksa-1 CreditAttribution: Oleksa-1 commentedOk, hope to see implementation of this feature in 6.3x
Comment #32
Grayside CreditAttribution: Grayside commentedLet's talk architecture.
What about adding a specific callback to the provider modules?
Comment #33
marvil07 CreditAttribution: marvil07 commentedThis will force implementations like vote on users/fields(planned) to have default fallbacks, which would work but it would start forcing the proposed way.
I am really not sure about including this feature, I would prefer that this would be implemented at the widget level. It should be possible using the drupal_alter in vud_vote with custom commands for the ajax things using the widget 'ajax render' callback.
Comment #34
marvil07 CreditAttribution: marvil07 commentedrealted #877392: Add hook that allows modules to alter voting permissions
Comment #35
Grayside CreditAttribution: Grayside commentedReading your comment and the linked issue, I am confused.
Are you suggesting you are open to per-widget patches using the forthcoming hook_vud_access() to add this option, or that you want this feature left out for a third-party/site custom module?
This is part of core use cases for a voting widget.
Comment #36
klonossubscribing... this is a really important feature and must be added. I too cannot understand why it was set to won't fix :/
Please reconsider Marco.
Comment #37
Grayside CreditAttribution: Grayside commentedSetting back to active just to gain clarification.
Comment #38
marvil07 CreditAttribution: marvil07 commentedLike mentioned in the related issue (#877392-6: Add hook that allows modules to alter voting permissions), I am inclined to provide a hook that would be implemented outside the module, but it would not provide a default hook implementations at the vud_* modules.
Comment #39
Grayside CreditAttribution: Grayside commentedThank you for clarification. I don't understand your position on what for me is the primary operating mode of any voting widget being used as other than a bookmarking tool. I would think the answer is to implement another configuration checkbox and check that in the _alter hook.
I will post a snippet once the patch lands.
Comment #40
castelar CreditAttribution: castelar commentedsubscribing
Comment #41
sandino CreditAttribution: sandino commentedsubscribe
Comment #42
klonosThis is a greatly desired feature, but after 2 years still no solid solution. I completely understand #33, #34 & #38, but still I need to achieve this and I see no obvious way. So, instead of turning this issue to a support request and re-opening it (risking the maintainer's wrath too), I've opened #1201938: How To: Disallow voting on your own content. Anybody with success recipes welcomed to share knowledge and experience there. Thanx beforehand.
Comment #43
drnikki CreditAttribution: drnikki commented@klonos - I'm working on a d7 patch for hiding the widget now.
Comment #44
marvil07 CreditAttribution: marvil07 commentedSee #1201938-3: How To: Disallow voting on your own content, on 6.x-3.x is possible implementing
hook_vud_access()
. Hopefully this issue will now rip :-)Comment #45
soulfroysI just re-rolled the patch #26 against the latest version (6.x-3.2)...
Warning: this patch will never be commited! As already said above, this issue is dead, and the real solution must implement the hook_vud_access(). I posted this patch here for reference only, until I have time to implement the correct solution.
Comment #46
Ainur CreditAttribution: Ainur commentedsoulfroys, disallow-vote-own-content-554360-45.patch needs to call ctools_include('ajax'); just before ctools_ajax_render_error.
Comment #47
soulfroysHi, It's already there, isn't it?