I've been upgrading a module and as the documentation says might happen, forms is becoming my biggest step.
I have one question so far. One of my conversions when using the forms updater might typically look like this:
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#default_value' => $edit['name'],
'#size' => 30,
'#maxlength' => 255,
);
When looking through the Drupal modules sometimes I'll see a similar structure without the blank field on the end so it will look something like this instead:
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#default_value' => $edit['name'],
'#size' => 30,
'#maxlength' => 255); Note there is no comma after the 255 on this version.
My question is: when is it okay to leave the comma off the end and why?
I'm asking this in the context of both creating a form and in the context of the following documentation:
"...In some cases, code may be written in such a way that form elements themselves (and not a fully themed form) need to be returned to a calling function. This is the case with many Drupal core hooks. in this case, simply return the constructed $form array, and let the calling code handle the form rendering..."
...as both circumstances are coming up in this upgrade effort. Any insight into this would be most appreciated!