Issue:
The problem with Filefield_sources is that when you try to reference an existing file through a Flexifield item the field will disappear upon pressing 'select'.

Possible cause:
The problem seems to be caused through AHAH+filefield+flexifield, it looks like it cannot output the proper response back to the browser.

Luckily it does work when 'Select' is NOT pressed (next to the reference existing file) by just saving the node directly.
We are willing to put a bounty on this fix.

Comments

reformatt’s picture

Status: Active » Patch (to be ported)

I created a quick fix for this problem. Please commit or upgrade.

reference.inc | line 112

/**
* A #process callback to extend the filefield_widget element type.
*/
function filefield_source_reference_process($element, $edit, &$form_state, $form) {

if ($element['#flexifield_storage']) {
$element_parents = '/'.implode(':', array_slice($element['#array_parents'], 0, -2));
$reference_path = 'flexifield-filefield/ahah/' . $element['#type_name'] . '/' . $element['#field_name'] . '/' . $element['#delta'].$element_parents;
} else {
$reference_path = 'filefield/ahah/' . $element['#type_name'] . '/' . $element['#field_name'] . '/' . $element['#delta'];
}