4.7 compatible version

tfejos - February 25, 2006 - 19:47
Project:Voting
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:benshell
Status:closed
Description

I experienced problems with form handling of this module with latest CVS HEAD Drupal, think it is for 4.6.
Could you please make it compatible with 4.7?

#1

benshell - February 26, 2006 - 07:06

This is on my to-do list, but paid work takes priority so it could be awhile before I get back to this module. However, if you submit a patch I'd be happy to apply it to the CVS version.

#2

m3avrck - March 2, 2006 - 18:58

Here's a patch which upgrades to 4.7 CVS.

However, seems to be a bit of a problem loading and saving the results from the flash file. Otherwise, good to go. And that problem might just be mine (uprading a 4.6 to 4.7 site).

AttachmentSize
voting.module.patch 28 KB

#3

tfejos - March 5, 2006 - 22:06

Thank you.
It works. If I select enable voting rado button for a content type it changes to disable after save settings. Voting appears on this nodes fine, but it is strange.

How can I translate voting to other languages? Would you please send .pot fill to me?

#4

evenamonkey - April 3, 2006 - 05:20
Title:4.7 compatible version» 4.7 compatible version - possible fix for save/load problem

I ran the patch I found around here to be 4.7 compatible and all was well except some nodes' votes would save while others would not.

i am using url alias and had pathauto module installed but not configured yet. i noticed that items I had set up aliases for would work while ones on pages with the generic "/node/##" would not.(the browser would show loading in the status bar and never complete)

my fix was to configure pathauto to be sure a custom path is generated for each item. Hope this helps someone else!

bye!
www.evenamonkey.com

#5

Steve McKenzie - April 13, 2006 - 18:39

I just posted a 4.7 install file for this module and said I would do a 4.7 conversion patch but didnt notice this issue.

Thanks for the 4.7 conversion.

#6

Jesse Grosjean - May 10, 2006 - 15:32

I applied the patch and it fixed most issues with 4.7, but I noticed a few problems. In particular the workflow settings aren't working correctly. I wasn't able to set the default workflow to allow voting for some node types. I fixed the problem (and made a few other modifications such as allowing collapsing of the voting options when editing a node) by changing the voting_form_alter() function to:

<?php
function voting_form_alter($form_id, &$form) {
 
// default workflow settings (administer/content/configure/content types)
 
if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) {
   
$form['workflow']['voting_'. $form['type']['#value']] = array(
     
'#type' => 'radios',
     
'#title' => t('Voting'),
     
'#default_value' => variable_get('voting_'. $form['type']['#value'], 0),
     
'#options' => array(t('Disabled'), t('Enabled')),
    );
  }
 
 
// editing a node
 
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
   
$node = $form['#node'];
    if (
user_access('administer nodes')) {
     
$form['voting_options'] = array(
       
'#type' => 'fieldset',
       
'#title' => t('Voting options'),
       
'#collapsible' => TRUE,
       
'#collapsed' => TRUE,
       
'#weight' => 30,
      );
     
$form['voting_options']['voting'] = array(
       
'#type' => 'radios',
       
'#default_value' => isset($node->voting) ? $node->voting : variable_get('voting_'. $form['type']['#value'], 0),
       
'#options' => array(t('Disabled'), t('Enabled')),
      );
    }
  }
}
?>

#7

Jesse Grosjean - May 11, 2006 - 17:40

This else needs to be added to the above code so that it works correctly for users without "administer nodes" access.

<?php
   
} else {
       
$form['voting_options']['voting'] = array(
         
'#type' => 'value',
         
'#value' => isset($node->voting) ? $node->voting : variable_get('voting_'. $form['type']['#value'], 0),
        );
    }
?>

#8

radiofranky2006 - July 11, 2006 - 00:10

can someone release this module for 4.7? thanks

#9

benshell - July 11, 2006 - 00:30
Title:4.7 compatible version - possible fix for save/load problem» 4.7 compatible version
Assigned to:Anonymous» benshell
Status:active» fixed

You're in luck, I just committed the 4.7 version to the repository a few minutes ago. It's not very thoroughly tested and I'm not using this version on any of my sites yet, so please post bug reports (and patches if possible) if you have any trouble with it.

#10

mudanoman - July 12, 2006 - 21:06

I just tested it and it looks like once installed the votes appears on all nodes regardless of the initial settings. Also the voting is not recorded. TIA, Ivan

#11

Anonymous - July 26, 2006 - 21:15
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.