Hello ,

I am experiencing difficulty in getting this module to work on my installation of drupal 5.1.

I have had a look at the code and there appear to be problems with both fivestar_nodeapi and fivestar_form_alter .

For ...

function fivestar_form_alter($form_id, &$form) {
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {

.. $form_id takes on page_type_form for a page , story_type_form for a story ,..
and isset($form['identity']['type'] is not set .

so i cant see the form for add voting without removing this if block at the moment

For ..
function fivestar_nodeapi(&$node, $op, $teaser, $page) {
switch ($op) {
case 'view':
if ($teaser == FALSE && $node->in_preview == FALSE && user_access('rate content') && variable_get('fivestar_' . $node->type, 0)) {

$teaser and $node->in_preview have nothing assigned to themselves and the 'fivestar' variable does not exist in the variable table so i can see the voting widget on node content at this time.

Would you please advise if this module has issues ?

Other contributed modules i am using privatemsg , og , views , frontpage , flickr , captcha , coolplay, sitemap , voting_api, delicious

Best Regards
Paul (Spreadfirefox Drupal Developer)

Comments

isko’s picture

Hi, i have nearly the same problem, i think. I've installed the VotingAPI and fivestar modules today. What I notices as first was a lack of documentation - intallation and usage description. After I've found the checkbox in content types (and yes, it was checked), there were still no stars for voting in the nodes.

So I played a bit with the code and was able to enable the display in my own theme by calling print fivestar_widget_form($node);
The problem is, I want to display the voting interface only by selected node types. So I fond the _fivestar_validate_target function - a very useful one. It returned always false. For each node, for each nodetype.

So could anyone please help? If you need more information about my Drupal instalation, just say what you need.

isko’s picture

Solved, no idea how... but it works for me now.

pelicani’s picture

Thanks for the tip of the theme call, I saw that and was hoping it would display the voting element, and it does.
However, I can't seem to removed the voting element from my node edit page.
Darn thing keeps giving us an error when you insert or edit the node.
Hopefully, this code will get cleaned up to be a little more friendly.
In the mean time, I'll have to 'hack' the bad code out to get the results we need.

pelicani’s picture

To eliminate the form error and the fivestar form from displaying in the node edit page, i had to comment out the two include files.
Seems like this will eliminate the admin settings, but it gets the darn voting form off the node edit form and doesn't report an error.
So it is getting there.
Now I need to figure out how to generate a view of a block to display on the node with the results of the voting.

quicksketch’s picture

Status: Active » Closed (fixed)

The checkbox in each content type was misleading, as it displays checked the first time you visit the content type page but actually isn't enabled. Re-saving the content type fixed the problem. This has been corrected and will be included in 1.5. Try out the latest development version until 1.5 and please open a new issue for each particular problem you are experiencing. I'm closing this issue as it's vague as to what the problems are. Feel free to create a new ticket after trying the latest version. Thanks!