Changes to the Voting module

(Submitted Sun, 2006-09-17 00:43) | | |

This is just to track the changes I've found necessary to get the voting module functioning correctly. (Hey, why is it that the Voting module doesn't have a proper drupal.org/project page?) I'm going to ping benshell to see if he's actively maintaining the module. I certainly hope so -- it's pretty slick.

It would be interesting to work on a similar module for Drupal 5.0 that would make use of the JQuery library rather than flash to achieve the same sort of functionality.

Two settings are sharing the same variable in the function voting_settings(). The result of this is that the option to choose where the voting control appears - at the top or the bottom of a node - does not show up in the settings page. Patch not presently available.

Quick Fix: In function voting_settings(), change the second instance of
$form['general']['voting_location'] = array(
to
$form['general']['voting_show_in_teaser'] = array(

Voting control does not appear in node teaser, even when this option is set. Essentially the same problem as above. The basic fix should be the same, but there are some other issues. Patch submitted but not reviewed.

Content types are not respected. Patch available, tested, works.

Voting controls suddenly disapear. There is a lot of the discussion at the above link, as well as a patch that I submitted that has fixed it for me as well as for at least one other individual.

Here's a patch that should help in most cases. It forces the voting module to respect the "always" setting in content types.

The problem is that when you add a new node, the voting module is always setting "voting" to 0 in the node_voting table. This patch should get things working for you again, but ultimately this more fundamental issue should be fixed.

Quick fix:
Change code beginning on line 395 to

case 'load':
$result = db_query("SELECT voting FROM {node_voting} WHERE nid = %d", $node->nid);
$node->voting = variable_get("voting_nodeapi_{$node->type}", 'never');
if ($node->voting == 'always') {
$node->voting = 1;
}
else
if ($voting = db_fetch_object($result)) {
$node->voting = $voting->voting;
}
else {

I'm tracking these here in order to sort them out. I believe the last two issues can be fixed in tandem as one patch, as they are both the result of the basic underlying problem. Additionally, I may have applied the patch for issue #3 before creating the patch for issue #4, so this should be revisited.

Submitted by drawk on Tue, 2006-09-19 13:40.

benshell is looking for a new maintainer for the module, due to time constraints.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
More information about formatting options

Hosted By Dreamhost.com


Did you know?

You don't need to register at WWDD to post comments.

Isn't it annoying when you want to comment on an article, but don't want to go through the hassle of creating yet-another-user account at yet-another-website?

Feel free to comment anonymously, or log in with your username@drupal.org account.

We won't mind a bit.