Index: fivestar.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/fivestar.module,v retrieving revision 1.13.2.69 diff -u -p -r1.13.2.69 fivestar.module --- fivestar.module 7 Jul 2009 03:48:36 -0000 1.13.2.69 +++ fivestar.module 31 Jul 2009 20:46:45 -0000 @@ -1043,17 +1043,18 @@ function fivestar_forms($form_id, $args) function fivestar_form(&$form_state, $content_type, $content_id) { global $user; + // FIXME what happens if $content_type != 'node' ? if ($content_type == 'node') { if (is_numeric($content_id)) { - $node = node_load($content_id); + $node_type = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $content_id)); } else { return array(); } } - $star_display = variable_get('fivestar_style_'. $node->type, 'average'); - $text_display = variable_get('fivestar_text_'. $node->type, 'dual'); + $star_display = variable_get('fivestar_style_'. $node_type, 'average'); + $text_display = variable_get('fivestar_text_'. $node_type, 'dual'); if ($star_display == 'average' && ($text_display == 'average' || $text_display == 'none')) { // Save a query and don't retrieve the user vote unnecessarily. @@ -1070,18 +1071,18 @@ function fivestar_form(&$form_state, $co ); $settings = array( - 'stars' => variable_get('fivestar_stars_'. $node->type, 5), - 'allow_clear' => variable_get('fivestar_unvote_'. $node->type, FALSE), + 'stars' => variable_get('fivestar_stars_'. $node_type, 5), + 'allow_clear' => variable_get('fivestar_unvote_'. $node_type, FALSE), 'style' => $star_display, 'text' => $text_display, 'content_type' => $content_type, 'content_id' => $content_id, 'tag' => 'vote', 'autosubmit' => TRUE, - 'title' => variable_get('fivestar_title_'. $node->type, 1) ? NULL : FALSE, - 'feedback_enable' => variable_get('fivestar_feedback_'. $node->type, 1), - 'labels_enable' => variable_get('fivestar_labels_enable_'. $node->type, 1), - 'labels' => variable_get('fivestar_labels_'. $node->type, array()), + 'title' => variable_get('fivestar_title_'. $node_type, 1) ? NULL : FALSE, + 'feedback_enable' => variable_get('fivestar_feedback_'. $node_type, 1), + 'labels_enable' => variable_get('fivestar_labels_enable_'. $node_type, 1), + 'labels' => variable_get('fivestar_labels_'. $node_type, array()), ); return fivestar_custom_widget($form_state, $values, $settings);