Generates Error in Drupal6 - Form Markup does not display

adf1969 - December 11, 2008 - 22:29
Project:Form Markup
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

When I add this module and add some prefix/suffix data, I get an error generated in the log:

errno = 8
message = Undefined index: prefix
filename: D:\\xampp\\htdocs\\avcorp\\sites\\all\\modules\\CCK.custom\\form_markup\
\form_markup.module
This is the line that generates the error:
$form[$field_name]['#prefix'] = $field['widget']['prefix'] . $form[$field_name]['#prefix'];

When running it through the debugger, I can see that $form[$field_name]['prefix'] does not exist, neither does $form[$field_name]['suffix']

I played with the code for quite a while but I'm not a Drupal programmer so I couldn't figure out why it didn't work (I just don't have enough of a grasp on the execution life-cycle to know when I should be expecting certain $form vars to exist. It seems that form_alter should be late enough in the page lifecycle that the form should be created by now, but apparently not...I did move the form_markup to module weight 10 and that at least caused the content.module to create the #field_info first, but the error still occurs).

If there is any other information I should provide, let me know and I will do what I can.

 
 

Drupal is a registered trademark of Dries Buytaert.