Closed (fixed)
Project:
Event
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2004 at 14:50 UTC
Updated:
15 Sep 2005 at 19:43 UTC
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
Comment #1
killes@www.drop.org commentedNo fields.inc in 4.6 anymore.
Comment #2
(not verified) commentedComment #3
(not verified) commentedComment #4
kmr2005 commentedComment #5
(not verified) commentedComment #6
pem commented