civicrm/civicrm-core — pull request #721 by ravishnair (2013-05-13 08:16:09+00:00)
Title: -- fix for CRM-10993

This issue is replicable for the case of Activity and Case as well. The patch provided is Grant specific. I have made a generic fix. The break was because the attachment file elements were not getting set in $uploadNames array, when "File" custom field is enabled. $uploadNames array for the attachment is built in "addUploadAction" function of Controller.php where a condition is checked " if (empty($uploadNames))" and then $uploadNames is set. But, when custom field of type "field" is enabled for any of these components, $uploadNames variables is set beforehand(it is set because CRM_Core_Form->addUploadElement is called while building "File" custom fields) and the empty($uploadNames) condition goes false, thus resulting in the attachment upload elements not getting set in $uploadNames. This fix works for all the components.