Fatal error: Call to undefined function db_fetch_object() in /home/daikinco/public_html/sites/all/modules/videojs/includes/videojs_style_plugin.inc on line 94
Fatal error: Call to undefined function db_fetch_object() in /home/daikinco/public_html/sites/all/modules/videojs/includes/videojs_style_plugin.inc on line 94
Comments
Comment #1
positivedm commentedI'm also getting this error when trying to use the VideoJS format in Views.
db_fetch_object is deprecated in Drupal 7. Does anyone know what line 94 of videojs_style_plugin.inc should be replaced with?:
$file = db_fetch_object(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fileid));Comment #2
ThoughtProcess commentedDisclaimer: I've been programming PHP for all of about 10 minutes.
Here's what I came up with:
$fileResult = db_query("SELECT uri FROM {file_managed} WHERE fid = :fileid", array(':fileid' => $fileid));
$file = $fileResult->fetchObject();
$filepath = $file->uri;
With that fix, I get some interesting errors (maybe someone else can pick it up from here?):
Comment #3
philosurfer commentedThis whole views implementation needs to be upgraded to views 3.
I will see what i can commit over the next couple days.. because i need this to work myself
Comment #4
ThoughtProcess commentedHas anyone made progress on this issue?
I am trying to teach myself more about the Views API (and Drupal programming in general) but it's proving to be a very involved task.
This weekend if I have the time I'll really read up on it and try to draft up a Views 3 implementation.
Comment #5
philosurfer commentedI am almost done with a views module right now. When I complete it , I will shift focus to this one. I got around dealing with this using a views list and then programmatically loading JS when necessary for the video.... messy.. but it worked. The Views API change quite a few things and will need almost a whole new rework of this plugin.
If anyone else willing to commit code time we can sprint on this in the near future. One thing we have to keep in mind is Media is almost ready for primetime and this should really be a plugin that works with media wrappers
any thoughts?
Comment #6
Serotonine commentedIs someone found where is the pb ?? this sounds very close to solution only some changes on "fid = :fileid", array(':fileid' => $fileid)"
I think...
$fileResult = db_query("SELECT uri FROM {file_managed} WHERE fid = :fileid", array(':fileid' => $fileid));
$file = $fileResult->fetchObject();
$filepath = $file->uri;
Comment #7
bart3d commentedSubscribing
Comment #8
Jorrit commentedThis file has never been updated to Drupal 7. The problem is, I have no idea what this styles plugin should do. Beyond the db_fetch_object() bug, there are other bugs, because I can't get it to work. If someone explains to me what this plugin should do, I can probably fix it.
Comment #9
Jorrit commentedClosed because of lack of response. The views plugin has been removed in 7.x-2.x, by the way.