I ported it form 1.x to 2.x, seems to be working all right.
Just have to apply the patch and extract the other files inside a /views directory (I was trying to fight cvs to make an all-in-one patch, but I was defeated).
I ported it form 1.x to 2.x, seems to be working all right.
Just have to apply the patch and extract the other files inside a /views directory (I was trying to fight cvs to make an all-in-one patch, but I was defeated).
Comments
Comment #1
franzComment #2
franzupdate, now with permission check
Comment #3
vanderlip commentedI am using WinZip to try to unzip the views.gz file. I think it should work with WinZip, but I get an "Invalid Archive Directory" error message from Winzip when unzipping the file.
Comment #4
franzThe file is working, I just tested it. I don't know which software you should use in windows, thought... =/
Comment #5
vanderlip commentedThanks franz. I found a tool to unzip the file on Windows.
Comment #6
jon nunan commentedNot sure why this issue got closed, its not in the 2.x branch yet as far as I can tell.
Installed the patch on the current 2.x Dev version, but the widget only seems to show up if I have selected the 'default' widget on the vote up/down settings page.
Comment #7
franzAnyways, I changed some things and added some access control to the handler
This goes inside VUD views/ folder
Comment #8
AntiNSA commented+1
Comment #9
marvil07 commentednice addition :-)
Some details:
- I think this change is for vud_node, so the relevant place to implement api would be vud_node. But maybe we can make this generic for all vud submodules
- it would be great if you use the new way of theming the widget(to let theme suggestions be used), take a look to the theme calls at the actual module.
Comment #10
ManyNancy commentedUnfortunate close. Thanks for the widget.
Comment #11
joecanti commentedThanks - great addition... Patch doesnt seem to go clean on the latest dev with patching software like Eclipse, but was applied manually with no problems and works great!
Will this be comitted to 2.x?
Thanks again, Joe
Comment #12
franzmarvil07, in the patch #7 I used the theme function I saw on vud_node_nodeapi(). Is that adequate?
I changed the whole patch to be used on vud_node. Haven't tested it yet.
Comment #13
Desi Raaj commentednoob question...how do i use this patch file... i understand that i have to extract the files in the views folder but what about the other one?
Comment #14
joecanti commentedpatching can be quite difficult at first - if your on windows you can use a software called Eclipse to do it. There are a few guides somewhere on Drupal.org.
First, download the .patch file by right clicking then save link as.
If you open it up you can see the '+' lines are added and the '-' lines are subtracted - from the module listed above them.
You could do it manually, which is useful to know for small patches - but for larger patches you will want to use software...
Basically, you download Eclipse, then create a new project, then import the original files to be patched into that project.
Then click on project > apply patch, then choose your patch, then choose which files are to be patched from your workspace, and then the software will try to match them up and do the patching.
The new files will be stored wherever the Eclipse project is stored - usually c:\users\workspace\myprojecthere etc etc
Good luck!
Comment #15
franzIf you use a Linux, just go into the module folder, copy the patch to ita and on a terminal type
patch < patch_file
;)
You can boot a LiveCD, it might take lesser time than installing Eclipse...
Comment #16
franzI also heard of a patch.exe which works fine on Windows... try to Google that!
Comment #17
marvil07 commented@Desi Raaj: The official documentation http://drupal.org/patch ;-)
Comment #18
Desi Raaj commentedThank you so much, i will give a try tomorrow and report back. i'm windows btw. Thank You.
Comment #19
marvil07 commentedI just made this changes a one-patch-file to make it easy to test.
Comment #20
marvil07 commentedI really want to make this change, but I would like to commit it when we have support for nodes, terms and comments.
I tried it, but not luck, so let me suggest about the raw patch:
use $Id$
we need to change that to make this compatible to the new way to pass message: passing it to vud_widget theme function. More information about it on #807928: Use modal div instead of popup at denying vote
$Id$
Not sure about it, but since we do not have tables, we do not need this.
In the other hand please use Vote Up/Down as the group name
A general comment, IMO we want to use vud instead of vote_up_down for namespace.
please use "Implementation of hook_views_api()."
Powered by Dreditor.
Comment #21
franzThat would require more work, but after fixing major issues with vud_node patch, shouldn't be that hard...
This is not just badly documented, but the argument is not even on hook_theme implementation. There is an argument with a message_code, which defaults to an error, please clarify this
Comment #22
marvil07 commentedAbout the specific issue you mention, I created #821048: make widgets easy to theme
About just badly documented, please provide real feedback, with specific details and/or patches to make docs better. Just say it do not help so much.
Comment #23
Donngal commentedi applied the patch and the .inc file in my VUD views folder, but i cant find a "VUD Widget" field in views, did i misunderstood this patch?
Comment #24
marvil07 commentedDonngal: please notice the status is "needs work", also notice I mentioned in #20 the patch is not working. So feel free to provide a new verison of the patch ;-)
Comment #25
franzAs much as you requested this patch to conform to some new rules with no details, I requested better info on that, believing that the developer is the one that understands his own code better. That's all, and as you see, I did provide very specific inquiries about the new theme function.
Comment #26
franzDonngal: The widget should pop out anyway, even with the problems that still require work, which patch did you apply?
Comment #27
Donngal commentedI applied the one from comment #12
Comment #28
dixon_Here is an updated patch that meets all of the comments from #20 plus some more cleanup and optimization.
Comment #29
snecci commentedWhat should happen after applying the patch #28? I did the following:
1. Fresh install vote_up_down-6.x-2.0-beta1
2. Apply patch #28 in the path modules/vote_up_down/vud_node with the command patch < 660258-vud-views-integration-28.patch
3. move the new files vud_handler_field_widget.inc and vud_node.views.inc to a new folder modules/vote_up_down/vud_node/views
hmm.. what should I happen next? I cannot find any new options under views... Thanks.
Comment #30
marvil07 commentedsnecci: issues categories do not use to change, so I'm moving it back to feature request, that is the actual category of the issue. For more reference take a look at Issue submission form fields.
Comment #31
Donngal commentedsubscribe, would like to get this working.
Comment #32
dixon_@snecci You must apply the patch in the root directory of the main vud module. The folder where
vud.moduleis located.Comment #33
snecci commentedThanks marvil07 and dixon_.
I applied the patch in the root directory. I guess my mistake was that I was not adding the -p0 option.
so now I did:
modules/vote_up_down$ patch -p0 < 660258-vud-views-integration-28.patch
It seems to patch the files correctly and I can see the VUD Widget under fields while creating a view, but I still cannot see the widget, just the label.
Any clues? Thanks.
Comment #34
marvil07 commentedHere it's an updated patch that use
hook_views_data_alter()instead ofhook_views_data()to avoid show this views field on not-node views. Also fixing some little naming errors.It seems to work, for vud_node, now let's make this possible for terms and comments.
Comment #35
jthomasbailey commentedI gave it a try:
So I tell it to patch vud_node.module...
And nothing happened. Can't find any new fields or relationships, subscribing.
Comment #36
marvil07 commentedhobgobbler: do not forget to clear the cache. about the patch it should work using
patch -p0 < file.patchComment #37
jthomasbailey commentedhey hey that time it worked -- I think the "-p0" did the trick
Comment #38
franzThis doesn't seem to be adequate, as we are trying to pull off an official integration for views. There is an attribute when implementing hook_views_data that excludes the field from appearing on some base tables...
Comment #39
marvil07 commentedRe #38: IMHO it _is_ adequate, actually it was a suggestion by merlinofchaos, who I asked for a solution to only show the widget in some views types, while I was trying to make this.
Use exclude make us unable to prevent show on inadequate places, but we _only_ want to show the widget for nodes on node views, and I think the same for terms(only taxonomy views) and the same for comments(only comments views)
Comment #40
marcoBauli commentedpatch at #34 seems to work fine up to now, thanks marvil07 :)
Comment #41
Donngal commentedmhh, id doesnt works at all for me, i get an Error: handler for vote_up_down > widget doesn't exist!
Comment #42
dixon_@Donngai You have to clear the cache to have Views read the new handler.
Comment #43
Donngal commented@dixon Sorry, clearing the cache doesnt solves the problem.
Edit: it works fine! made some patching mistakes, and i had to replace the function call "vud_theme_functions" on line 36 in the vud_node_handler_field_widget.inc file with "views_theme_functions".
Comment #44
franzre #39: Ok, that's fine. What else is needed for the patches to be commited?
Comment #45
marvil07 commented@franz: thanks for remember me to change the status again. Like mentioned above, I would like to commit this we have support for nodes, terms and comments. Now we have complete node support, so let's do the same for terms an comments.
Anyone feel free to provide a patch, I'll be taking a look to this the next week to push it until committed ;-)
Comment #46
marvil07 commentedsupport for comments :-)
After this we only left support for taxonomy
Comment #47
marvil07 commentedto follow integration with vud_term, I need a clarification: #837332: use the right tag for vud_term?
Comment #48
boran commentedSubscribe. Tried #34 patch, worked fine for nodes. Thanks.
Comment #49
Desi Raaj commentedok, i have patched this module using the patch in #34, but is there anyway to sort it by the number of votes in views? i have defined a relationship "Node: Vote results" and tried defining a sort criteria "(Vote results) Vote results: Value desc" but it doesn't sort. please help. thank you
(Views Setup) http://img195.imageshack.us/img195/8562/screenshot20100627at122.png
(result) http://img188.imageshack.us/img188/8132/screenshot20100627at123.png
Comment #50
franzHi Desi, most of the work here is to expose the fields properly you can use the widgets on views. The feature you suggest is great also, but I think you could open a new feature request issue for that. First we crawl, then we walk... ;)
Comment #51
Desi Raaj commentedawesome, i will do so. thank you
Comment #52
marvil07 commentedbased on #837332: use the right tag for vud_term?, for vud_term we need to make views_data_alter on node implementation of views_data, because vud_term depend on a nid for its tag.
Comment #53
marvil07 commentedOk, after re-working vud_term as mentioned and updating code since #821048: make widgets easy to theme I committed this to 2.x and 3.x.
Thanks all!
BTW: I'm going to make a beta2 now ;-)
Comment #54
franzDesi, I just checked what you suggested, and I remembered that votingapi expose such sort criteria (Vote results), that should do the work, I think. BTW, did you open any issue about this? If so, please link here for a reference
Nice to know it's finished, marvil07! =)
Comment #55
marvil07 commented@franz: #839022: Add Views Sort Criteria
Comment #56
grenit commentedHi all,
VUD widget does not appear for me after applying #46.
sites/all/modules/vote_up_down# patch -p0 < expose-widgets-as-views-fields_v9.patch
patching file vud_comment/views/vud_comment.views.inc
patching file vud_comment/views/vud_comment_handler_field_widget.inc
patching file vud_comment/vud_comment.module
Hunk #1 FAILED at 193.
1 out of 1 hunk FAILED -- saving rejects to file vud_comment/vud_comment.module.rej
patching file vud_node/views/vud_node.views.inc
patching file vud_node/views/vud_node_handler_field_widget.inc
patching file vud_node/vud_node.module
patching file vud_term/views/vud_term.views.inc
patching file vud_term/views/vud_term_handler_field_widget.inc
patching file vud_term/vud_term.module
Hunk #1 succeeded at 182 with fuzz 2 (offset 10 lines).
I thought this meant success, so I emptied Drupal cache (is this the cache I have to empty?), but I could not use the vud widget in views. Anyway, after this I removed files from vote_up_down/vud_node/views, and applied #34:
sites/all/modules/vote_up_down# patch -p0 < 0001-660258-Added-expose-widgets-as-views-fields.patch
patching file vud_node/views/vud_node.views.inc
patching file vud_node/views/vud_node_handler_field_widget.inc
patching file vud_node/vud_node.module
Hunk #1 succeeded at 58 (offset 10 lines).
VUD widget still does not show up in Fields. What else do I have to do?
Comment #57
ManyNancy commentedPatch is included in latest release, just update to latest release?
Comment #58
grenit commentedYes, thank you. Field is now accessible, but actual widget does not show up in table style. Will check later when I have time.
Comment #59
grenit commentedChanged nothing, but now widget is displayed. Must have been some cache, maybe browser...(?) As far as I remember I emptied Drupal cache.
Comment #60
grenit commentedNo, it was user permissions.
Comment #61
avior commentedHi
I have installed 6.x-2.0-beta2 version
i am trying to show comments in a view with the vote widget , i can add the vote widget in views but i see nothing when showing the view
(it's not permission issue because i can see it in the default comment view)
is this patch got into 6.x-2.0-beta2 version or do i need to patch ?
Comment #62
marvil07 commentedavior: please do not hijack the issue(this is not a support issue), its status is fixed and like mentioned above it is commited to 2.x and 3.x
Comment #63
avior commentedHi @marvil07
My only question was
is this patch got into 6.x-2.0-beta2 version or do i need to patch ?
Comment #64
marvil07 commented@aavior: as mentioned in #53 I releades beta2 after commiting this patch
Comment #66
fourmi4x commentedBut this is not on 6.x-3.0-alpha1 ? (can't see it!)
EDIT : Sorry - I misconfigured it... it works fine !