Maps help text appearing on every content type field.
matw8 - January 27, 2009 - 11:52
| Project: | cck_map |
| Version: | 5.x-3.2-1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
After enabling the CCK_MAPS module and creating content types that don't contain a map field, the help text for cck_maps appears in the help text field of every other field.
I resolved this by editing the cck_map_form_alter function and adding some extra parenthese so that the test for field type encloses the whole function, and not just the next line.
My new function is as below
function cck_map_form_alter($form_id, &$form) {
if ($form_id == '_content_admin_field') {
/* */
if ($form['field_type']['#value'] == 'map_location') {
unset($form['widget']['default_value_fieldset']);
if (!strlen($form['widget']['description']['#value']))
$form['widget']['description']['#value'] = "Click the map to place markers. Once placed, you can drag markers around to change their location, you may also click to edit or remove them.";
}
}
}
#1
The module should use $form['widget']['description']['#default_value'] instead of $form['widget']['description']['#value']