Posted by ezra-g on January 9, 2012 at 7:50pm
3 followers
| Project: | Vote Up/Down |
| Version: | 6.x-3.x-dev |
| Component: | vud_node |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I'd like to add a simple drupal_alter() so that we can alter the widget type based on information in the node object.
I see this as a reasonable stopgap for the Drupal 6.x-3.x branch since #793048: Per content configuration is postponed.
My motivation is to have a single site using Vote Up/down with 2 different widgets depending on the node type.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| vote_up_down_node_widget_alter.patch | 1.18 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 129 pass(es). | View details |
Comments
#1
Sounds pretty reasonable.
+++ b/vud.api.php@@ -70,3 +70,16 @@ function hook_vud_votes(&$votes) {
+function hook_vud_node_widget_alter(&$widget, $node) {
Please move the this documentation to
vud_node/vud_node.api.phpand I could push your patch.#2
Actually there are some other places where we should add the alter too:
$ git grep -n "variable_get('vud_node_widget'"vud_node/views/vud_node_handler_field_widget.inc:42: $widget_type = variable_get('vud_node_widget', 'plain');
vud_node/vud_node.module:88: '#default_value' => variable_get('vud_node_widget', 'updown'),
vud_node/vud_node.module:149: $widget = variable_get('vud_node_widget', 'plain');
vud_node/vud_node.module:256: $widget_theme = variable_get('vud_node_widget', 'plain');
#3
Thanks for the fast review!
Here's a re-roll with slightly updated documentation.
I left out altering
vud_node/vud_node.module:88: '#default_value' => variable_get('vud_node_widget', 'updown'),since that's where we set the default and the purpose of the new hook is to alter the default on a per-node basis.Thanks!
#4
Sorry for the delay here. Thanks for the patch, added to 6.x-3.x.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.