I`m brand new to Drupal and just installed Drupal 5 along with CCK and Mediafield.

I can make a new CCK-based content type with just CCK and everything loads up fine with the default node.tpl.php and everything, but problems arise when I insert an audiofield into my content type.

Currently whether I actually put a file into the node or not, just having the audiofield.module field in my content type causes a blank page to appear when I reference the node.

BUT - as soon as I submit the new node (or resubmit an old node) the preview shows all the content correctly in the context of the edit section. But as soon as I click `View` all I get is a blank page.

I have installed getid3 into the Drupal base directory misc/lib/ directory, and looking around the other support requests that seems to be the place.

Is there something basic I`m missing here? I find it very odd that the post-submit preview shows my information but viewing the node on its own causes a blank page to appear (which I can only assume means a PHP-based error somewhere).

Comments

ardas’s picture

1. Did you change node.tpl.php or any other template somehow? If so, please write what exactly did you change there. It looks like a problem with output but not with the module itself.

2. And also turn on errors in either your php.ini file or in put these lines into Drupal settings.php:
ini_set('display_errors', 'On');
ini_set('error_reporting', E_ALL);
This will help you to see which error occured.

gekokujou’s picture

AH! Fantastic, thank you so much for pointing out how to get PHP to display errors, I can`t believe I`ve been doing this for a year and never came across that...SO helpful. Thank you.

Okay, so according to the output with an audiofield in my content it gives me:

Fatal error: Call to undefined function _field_file_load() on line 316

which I think is what the other issue that you resolved from 4.7 code with the require_once in audiofield.module. The line in my document is as follows:
audiofield.module:

require_once(drupal_get_path('module', 'audiofield') .'/multimediafile.inc');

And just for completeness` sake, here is the function itself in multimedia.inc:

function _field_file_load($fid = NULL) {
  if (isset($fid)) {
    if (is_numeric($fid)) {
      $result = db_query('SELECT * FROM {files} WHERE fid = %d', $fid);
      $file = db_fetch_array($result);
      return ($file) ? $file : array();
    }
  }
  return array();
}

As for themes, I`m using the Zen theme (as I said, I`m a beginner trying to make my own bit from the bottom up), and I have left their node.tpl.php file intact.

gekokujou’s picture

I may have solved the problem.

I read your other post about putting the require_once line in the formatter hook so in the audiofield_field_formatter function I copied and pasted the require_once code and it seems to work.

ardas’s picture

Yes. This is a known issue.
By the way, I have fixed it and commited changes. So, please download the new version and try it.

Thanks for your help.

ardas’s picture

Status: Active » Closed (fixed)