I've added the audio file field to be listed in a Views table display but the module dies with the error message:
Call to undefined function _field_file_load() in /var/www/html/drupal-5.0/sites/all/modules/mediafield/audiofield.module on line 316

Comments

budda’s picture

The correct code for the broken function should be:-

/**
 * Implementation of hook_field_formatter().
 */
function audiofield_field_formatter($field, $item, $formatter) {
  if (!isset($item['fid'])) {
    return '';
  }
  $file =  _filefield_file_load($item['fid']);
  return theme('audiofield', $file, $item, $filed);
}

I replaced _field_file_load() with _filefield_file_load().

I suspect you should be using the module_invoke() hook to access the filefield module function, rather than going direct. Or.... the audiofield.info file should be updated to include the fact that you need the filefield.module installed to use audiofield? - otherwise clone the function and put it in the audiofield.module

budda’s picture

Title: PHP Error when display data in a Views table » audiofield: PHP Error when display data in a Views table
budda’s picture

Status: Active » Closed (duplicate)