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.
There is already code for a field implementing vote up down on the git repository.
IMHO making 4 submodules for vud implementation is too much, and since we can replicate most of the work done on those modules through a general field implementation, I am completely in favour to deprecate the ones mentioned in the title.
In the other side, I think this can be a big win because it would be a lot code less to maintain.
This idea was mentioned on the original D7 port some time ago: #749438-95: Port Vote Up/Down to D7
Comment | File | Size | Author |
---|---|---|---|
#6 | 1295574-vote-up-down-set-default-value-for-empty-items-4.patch | 961 bytes | vlkff |
Comments
Comment #1
drnikki CreditAttribution: drnikki commentedI think that's a great idea. Can you (or have you already) committed that first patch that lets VUD run on d7 so we can help you do some of the rest of the work?
Comment #2
marvil07 CreditAttribution: marvil07 commentedGreat to know about it, yeah, code is there in two branches: 7.x-1.x and vud_field. I was hoping to get it fully working but you are right, I will merge the code at vud_field onto 7.x-1.x and then remove that branch.
Update: Last code is now on 7.x-1.x
Comment #3
mnbroderick CreditAttribution: mnbroderick commentedJust wondering, do you want people to start testing with the field module instead of the old submodules?
And we cannot remove those extra submodules yet because that is how the views implementations are working, right?
I also assume we'll still be able to just call the related widget in the tpl.php ourselves if we don't want to display it as a field.
Comment #4
boran CreditAttribution: boran commentedI'd be happy to test and use the field version of vud.
- pulled from git and enabled vud_field.
- in the content type a Vote field was added of Field/Widget="Vote UpDown".
- under Manage Display the format for vote was set to "Vote UpDown(default)"
The widget is not appearing.
Errors:
php Notice: Undefined index: vud_widget in vud_field_field_formatter_view() (line 160 of /disk2/www/drupal-7.8/sites/all/modules/drupal.org.git/vote_up_down/vud_field/vud_field.module)
php Notice: Undefined index: votingapi_tag in vud_field_field_formatter_view() (line 161 of /disk2/www/drupal-7.8/sites/all/modules/drupal.org.git/vote_up_down/vud_field/vud_field.module).
The $items array is empty in vud_field_field_formatter_view().
Strangely, If I edit and save a node, then the widget appears (and $items contains vud_widget/tag). This is the case for all nodes.
P.S: I still think vud_node is needed, for example for sites migrating from D6 and wishing to preserve votes.
Comment #5
vlkff CreditAttribution: vlkff commentedI will take care of that bug and provide a patch
Comment #6
vlkff CreditAttribution: vlkff commentedActually it is related to http://drupal.org/node/1365382.
Duplicated the comment there too.
The problem is that the field items is empty before node object is saved (or resaved how it is described in note#4) with values for items provided by
I solved the problem with hook_field_prepare_view() , in the same way as default image implemented in image.module, and as for me it is a good solution.
But while a patching I noticed that you can't change voting settings for specific entity and in terms of that, storing 'vud_widget' and 'votingapi_tag' for each entity is useless.
So I think that we have to make voting settings configurable for a particular entity too or rework the data storing. Making voting settings configurable for a particular entity looks more attractive for me , because that feature will be required by users, but probably it is an object of discussion.
Comment #7
marvil07 CreditAttribution: marvil07 commented@Nikot: vud_field is a standard field, so views will recognize it, and can show it. Yeah, if you now what you are doing you can do things manually always, based on the api provided by vud module, but hopefully you don't need to do that.
@boran: I guess that errors are gone now. About sites coming from D6, I plan to make an upgrade path, see #1363928: Upgrade paths from vud_{node,comment,term} to vud_field
@vlkff: Your comment at 6 answered in context at #1365382-4: Preload vud_field based on field settings
Comment #8
boran CreditAttribution: boran commentedFYI, I have vud_node/comment working enough for me on D7 (with upgrade from D6) that I use for one specific site. Only a subset of vid is being used.
I can put the code in a sandbox if it helps, but I guess you want to kill vud_node/comment and get us on fields :-)
Comment #9
kingdee40 CreditAttribution: kingdee40 commentedI've been using the vud_field for a couple weeks now everything seems to be working ok. I was just wondering if anyone was able to sort the view based on the number of votes. Again I am only using the vud field.
Comment #10
mgiffordBeen over a year on this issue. Any thoughts about the patch in #6?
Comment #11
Chrissuli CreditAttribution: Chrissuli commentedSo where do I find the vud_field!?
According to the 'search' There do not appear to be any registered modules by that name, nor are there any links to it from other dependent modules.
Can anyone send me the link please?
Kr,
Chris
Comment #12
kingdee40 CreditAttribution: kingdee40 commentedIt's not a separate module, it's part of the vud module.