I ran into some trouble modifying the event module, before I discovered that fields.inc would not work properly for defining fields that were not of form textarea or textbox or select. This was because drupal's form_{various types} functions expect different arguments for different types. In function event_form I added some code to support checkboxes/radios:

>
    if (in_array($def[0], array('password', 'textfield', 'textarea'))) {
      $output .= $function($def[1], $field, $node->$field, $def[7], $def[8], $def[9] . theme_error($error[$field]), $def[10]);
    }
    else if (in_array($def[0], array('checkbox','radio'))) {
       $output .= $function($def[1], $field, 1, $node->$field, $def[6]);
    }
    else {  //apparently assumes field is form_select
      $output .= $function($def[1], $field, $node->$field, $def[7], $def[8] . theme_error($error[$field]), $def[9], $def[10]);
    }

(I needed it as an easy way to support indicating events that happen at no particular time). If you choose not to add the feature, it would be nice to add a comment to fields.inc specifying the restriction to certain types of form.

Comments

killes@www.drop.org’s picture

Version: » 4.6.x-1.x-dev
Status: Active » Fixed

No fields.inc in 4.6 anymore.

Anonymous’s picture

Anonymous’s picture

kmr2005’s picture

Anonymous’s picture

pem’s picture

Status: Fixed » Closed (fixed)