Error retrieving node with media field

stg11 - May 26, 2007 - 00:23
Project:Media Field
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I created a custom content type with the video field and a plain text field.

I uploaded a .wmv video and posted it to an organic group. It seemed to be working ok -- I was able to download the video and it played. Then I went back to view the node again and it got the following error.

Fatal error: Call to undefined function _field_file_load() in /var/www/html/th/thecreatornetwork.org/drupaltest/sites/all/modules/mediafield/videofield.module on line 331

The video is about 17MB.

I can still go to the file on the site and download it directly. Is there something I am doing wrong or is this a bug? Should I use the dev version instead, since it is more recent?

I have to admit this is my first Drupal site -- I've been studying it for a while but am still somewhat of a novice.

Thanks
Edwin Basye

#1

mrgoltra - June 9, 2007 - 19:41

have fixed this problem. I am getting the same problem but mine when I submit the node.

#2

jeffreydalton.info - June 11, 2007 - 20:52

I am also getting this error when trying to view node. I used audio type and text field and when i try to view node I get this error:
Fatal error: Call to undefined function _field_file_load() in /var/www/html/staging/williams/modules/mediafield/audiofield.module on line 316

#3

stg11 - July 3, 2007 - 23:28

I am getting the same error on a video (mpg) file

#4

stg11 - July 12, 2007 - 19:12

Using the latest dev release I did some more testing. I added a video in a video mediafield and It seems to work under my windows environment where I have apachetriad2 running. I tried moving it to my web server and I get this:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/th/thecreatornetwork.org/drupaltest/sites/all/modules/mediafield/audiofield.module on line 433

This occurs on any node of the site I try to access.

I thought it might be the difference in PHP versions (5 on local Windows, 4 on web host server), so I switched it to 5 temporarily and got the same result. Maybe there is a missing or extra quote mark somewhere?

#5

dsw9742 - July 24, 2007 - 14:28

looks like '$field' is misspelled as '$filed' under the '_field_file_load' function in both modules:

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

line 332 in videofield.module:
/**
* Implementation of hook_field_formatter().
*/
function videofield_field_formatter($field, $item, $formatter) {
if (!isset($item['fid'])) {
return '';
}
$file = _field_file_load($item['fid']);
return theme('videofield', $file, $item, $filed);
}

Can anyone try this fix and confirm?

#6

zuus - August 13, 2007 - 15:04

I get the error as well with the video field on a node view. I dont think it is mis-spelled variables, its that the multimediafile.inc is not being parsed by php before videofield.module is, so then the undefined function error is presented.

#7

mrenoch - August 23, 2007 - 20:50

I think the suggestion that multimediafield.inc is not loaded in time is close - if I add

require_once('multimediafile.inc');

to the top of the audiofiield.module (1.0) file I can view the node.

In the dev version I see that:

require_once(drupal_get_path('module', 'audiofield') .'/multimediafile.inc'); is now at the top of the audiofield_field_formatter function, so this is probably the recommended fix.

Still, the mispelling in the them call might be a separate issue - $filed is not in scope, though both $file and $field are.

#8

lynnpauls - September 10, 2007 - 18:33

xykon has made a patch that completely fixes the issue causing the error on line 331 message. Here's a link to his patch ...... text link for those needing to copy/paste http://drupal.org/files/issues/videomodule.patch

#9

scottrigby - November 26, 2007 - 21:51

patch seems to have worked for me - thx

#10

a_c_m - December 20, 2007 - 10:54

Patch could do with modding the audio module too... has it been submitted to the dev's yet?

#11

a_c_m - June 10, 2008 - 15:18
Category:support request» bug report
Priority:normal» critical
Status:active» patch (reviewed & tested by the community)

#12

Manuel Garcia - June 25, 2008 - 14:09

To use the patch on the audiofield.module, just add the line

<?php
require_once(drupal_get_path('module', 'audiofield) .'/multimediafile.inc);
?>

after line 312:
<?php
function audiofield_field_formatter($field, $item, $formatter) {
?>

Also make sure to fix the typo in line 318, it has

<?php
return theme('audiofield', $file, $item, $filed);
?>

and should be
<?php
return theme('audiofield', $file, $item, $field); 
?>

The same goes for the videofield.module, just do a find and replace for $filed --> $field

Thanks, this seems to fix the bug.

#13

a_c_m - June 26, 2008 - 07:35

Now fixed in HEAD (http://drupal.org/cvs?commit=123606), new release on its way after other critical bugs are fixed.

#14

a_c_m - June 26, 2008 - 07:36
Status:patch (reviewed & tested by the community)» fixed

#15

Anonymous (not verified) - July 10, 2008 - 07:42
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.