After applying the patch you left for the Mediafield module (http://drupal.org/node/144674), i would get a critical fail when trying to edit any node with a mediafield on it.
Fatal error: Class 'getID3' not found in .../sites/all/modules/getid3/getid3.module on line 59
The problem is 2 fold, first
/**
* Loads the getID3 library once and returns whether it was successfully loaded.
*
* @return
* Boolean indicating if the library was loaded
*/
function getid3_load($display_warning = TRUE) {
@(include_once(getid3_get_path() .'/getid3/getid3.php')) or _getid3_library_not_found($display_warning);
$version = GETID3_VERSION;
return !empty($version);
}
The line "return !empty($version);" will never return false (on my install of php at least) as even if GETID3_VERSION was not set by getid3.php it will be "GETID3_VERSION" and so never empty, a better check is "return ($version != 'GETID3_VERSION');"
Part 2 is that this variable returned from getid3_load() is never used by getid3_instance()
/**
* Create and initialize an instance of getID3 class.
*/
function &getid3_instance() {
getid3_load();
$id3 = new getID3();
$id3-> option_md5_data = true;
$id3-> option_md5_data_source = true;
$id3-> encoding = 'UTF-8';
return $id3;
}
this should instead be
/**
* Create and initialize an instance of getID3 class.
*/
function &getid3_instance() {
$id3 = null;
if (getid3_load()) {
$id3 = new getID3();
$id3-> option_md5_data = true;
$id3-> option_md5_data_source = true;
$id3-> encoding = 'UTF-8';
}
return $id3;
}
I've attached a patch to this effect.
| Comment | File | Size | Author |
|---|---|---|---|
| versioncheck.patch | 961 bytes | a_c_m |
Comments
Comment #1
a_c_m commentedoh also i'm going to still install your patch for MediaField but with a bit of extra logic which will become redundant once this patch (or similar) is installed, just FYI.
Comment #2
robloachhttp://drupal.org/cvs?commit=123697
http://drupal.org/cvs?commit=123696
If there's still a problem with it, please feel free to re-open the issue.
Comment #3
drewish commentedi'd have preferred to have backported the
defined('GETID3_VERSION')fix i did in D6 for the first problem:but the fix for the second problem is probably correct.
Comment #4
robloachThat sounds reasonable.
Comment #5
drewish commentedi think this is "fixed" in d6 so if there's still an issue it's in 5. i'm willing to let sleeping dogs lie (lye?, lay?).
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.