Closed (fixed)
Project:
Media Field
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2007 at 20:09 UTC
Updated:
24 Jan 2008 at 06:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
eojthebraveOops. I diffed in the wrong direction. This one is correct. Sorry about that, I'm still kind of new to this.
Comment #2
ardas commentedDo you think including INC file in init hook is better than in every CCK hook?
Including php file in init hook means it will be included when all modules are loaded even when it is not needed.
Comment #3
ardas commentedI still can't reproduce this issue in 5.0. I include this file in three functions (CCK hooks):
1. function audiofield_widget()
2. function audiofield_field()
3. function audiofield_widget_settings()
I wonder, isn't it enough and in which cases the problem occurs? Could you describe me your scenario? Thanks.
Comment #4
eojthebraveHere's what has been happening to me. I create a new node with an audio field, and the first time I view that node everything works fine (pre-cache). If I try and view the node again it's pulling it from the cache table, and then throws the undefined function error when the audiofield_field_formatter function gets called as this function calls the _field_file_load function (line 316 of audiofield.module).
The reason I think it has something to do with the cache table is that if I empty my cache table I'm able to view the page once (before the cache gets created) however all subsequent attempts to view the page fail. I'm not really sure why this is happening, I don't even have caching turned on at this point, yet the problem continues.
I don't necessarily think including the INC file in hook_init is the best option, but it's what worked for me at the time. There may be a better way to go about it that I am unaware of.
Let me know if there are any other details I can provide.
Comment #5
ardas commentedYeah. Looks like formatter hook was the last one where multimediafile.inc wasn't included. I wonder, why it worked for the first time:) May be because widget hook is called for the first time. Okay, I put require_once into the formatter hook (HEAD, 4.7, 5.0). Please download the latest release when it is ready and try pass your scenario. I hope it should help. I prefer to avoid including this file in the hook_init() because of two reasons:
1. Theriotically, it is a bad practice to include everything in the beginning because for most page loads this file is not needed.
2. In Drupal 5.0 there is an aggressive cache and if modules implement init or exit hooks they are not compatible with agressive cache! So, I am trying to avoid them when possible.
Thanks for your help.
Comment #6
ardas commentedComment #7
joachim commentedI've just downloaded and installed the latest release, 5.x-1.x-dev 2007-Feb-22 15.09 KB
I still get the problem:
Fatal error: Call to undefined function: _field_file_load() in /home/seasider/public_html/drupal5/sites/all/modules/mediafield/audiofield.module on line 316
Comment #8
ardas commentedIt is hardly possible. I've just downloaded the 5.0dev release and there is a
require_once(drupal_get_path('module', 'audiofield') .'/multimediafile.inc');
in function audiofield_field_formatter() and must not get this error when calling _field_file_load() function.
You probably have an old version.
Comment #9
(not verified) commentedComment #10
sage2046 commentedI am an absolutely newbie to drupal, and i met the error which is "Fatal error: Call to undefined function _field_file_load() in E:\www\modules\mediafield\audiofield.module on line 316"
seems this patch could save my life, but the problem is how to use the patch ??
any reply would be appreciated !
Comment #11
panis commentedgo line 316 and right before the line that says _field_file_load() add the following:
require_once(drupal_get_path('module', 'audiofield') .'/multimediafile.inc');Comment #12
headkit commentedthanx! this worked for me.
Comment #13
headkit commentedbut how do I push the uploaded songs into a player?
Comment #14
Petuschki commentedwell, this problem is known at least since last may 07
I downloaded the module and installed it in January 08
the error was still there
then I had to search around to find this thread
I edited the file and included the "require_once" in the module and the error was gone
instead of that now I get the message "getid3 library not found!" from time to time
before the library was found
let me express my deep frustration: I understand the possibilities and structure of Drupal, and that is the reason why I try since some weeks now to create a Drupal environment where the simplest things like a working editor, including multimedia files etc. will be provided
it is not the complexitiy of Drupal, that makes life so hard, it is the horrible maintenance of the modules etc...
what to do now with this error message?
Uninstall everything and experiment with the next MultimediaModule which will throw out other unexpected messages and errors?
As I said, I am deeply frustrated ;=(
Comment #15
ardas commentedGuys, sorry for not maintaining this module for a long time. Unfortunatly, we have no people for this work ni the company. In the nearest future I'm going to maintain it again, apply patches and develop a D6.0 version.
Also, there is a discussion with Dopry who developed a filefield.module about our INC file with common functions. Dopry said all these functions will be included in his filefiel.module but it wasn't done yet as I know. I'm starting to pushing this question ahead.