[drupal-devel] Problem with new form API in _upload_form

Tim Altman web at timaltman.com
Sun Oct 23 22:15:44 UTC 2005


I ran into a problem with the new form API while I was investigating a bug  
with file uploads.  The bug is that the list attribute and description for  
uploaded files aren't saved.  I've solved the bug with the list attribute,  
but I can't figure out the correct solution for the bug with file  
descriptions.  The form in _upload_form outputs the descriptions as  
$node['attachments']['current']['description'] whereas the delete and list  
checkboxes are output as $node['remove'] and $node['list'], respectively.   
Descriptions are nested so deeply because the #tree attribute is set to  
TRUE for $form['current']['description'] in _upload_form which is returned  
into $form['attachments'] by upload_form.

So, should upload_save expect  
$node['attachments']['current']['description'] or is there a way to fix  
this so it works as it did before?  I see no reason for descriptions to be  
nested so deeply in the form.

Tim Altman

More information about the drupal-devel mailing list