Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
reformatt CreditAttribution: reformatt commentedI 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'];
}