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.
OK, I added vud_field to one node type, configured it properly, but it doesn't show anywhere (not on the node edit for, or the node view).
Using devel and dpm(get_defined_vars()); shows that the field is completely empty, although the variable is set.
Am I doing something wrong?
PS. I tested this with the 7.x-1.x-dev that drush downloads, and the one from git.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1295574-vote-up-down-set-default-value-for-empty-items-4.patch | 961 bytes | vlkff |
Comments
Comment #1
JeremyFrench CreditAttribution: JeremyFrench commentedI have found that you need to save the node before the widget will appear.
Comment #2
vlkff CreditAttribution: vlkff commentedThe 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 #4
marvil07 CreditAttribution: marvil07 commented@vlkff: Thanks for the patch!
I have just commushed it to 7.x-1.x
About:
I guess it was a bug before some commits. If you are able to reproduce it in current 7.x-1.x please open a new issue about it.