Alternate points style template not used

mrwendell - April 7, 2009 - 19:54
Project:Vote Up/Down
Version:6.x-1.0-beta4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

If the alternate voting widget is used, the template used for points is vote_up_down_points.tpl.php not vote_up_down_points_alt.tpl.php

Drupal 6.10, I have the regular widget for nodes, but the alternate widget for comments.

I have been looking through the code and I can't seem to track down the problem.

Couple things I noticed were

A) in your function there is no case for 'vote_up_down_points_alt' - adding one does not fix the probelm. However changing vote_up_down_theme() for the case 'vote_up_down_points' to the alternate points template, did get that file to be used.

B) I also noticed $variables['style'] was not being set. As such for alternate points styles the variable $variables['template_files'] was never set in the template_preprocess_vote_up_down_points() function(line 727-9)

if (isset($variables['style'])) {
    $variables['template_files'][] = 'vote_up_down_points_'. $variables['style'];
  }

Rectifying this again didn't fix the problem. After that I have pretty much given up as I have no idea how you call your theme files. I would love to learn if anyone knows!

#1

mrwendell - April 7, 2009 - 20:06

Figures, right after I submit I figure out the fix. Change Line 728 (vote_up_down.module)

From

$variables['template_files'][] = 'vote_up_down_points_'. $variables['style'];

To

$variables['template_files'][] = 'theme/vote_up_down_points_'. $variables['style'];

Seems to correct the problem. I had tried that before but I was using 'themes' instead of 'theme' - like duh!

Not sure how the whole patch procedure works in Drupal so I haven't changed the status of this issue.

#2

bbeyer - May 28, 2009 - 15:05

This seems to be fixed if you get the latest dev version, 6.x-1.x-dev

 
 

Drupal is a registered trademark of Dries Buytaert.