In 1.9.0: [2011-06-20]
¤ GETID3_VERSION constant replaced with $getID3->version()

Comments

anrikun’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

The attached patch addresses this issue.

franzkewd’s picture

Thanks.

vm’s picture

Confirmation that this patch works. Admin settings for the getid3 module now recognize the 1.9.0 library.

Looking at the getid3 changelog I'm guessing the required change is due to:

¤ GETID3_VERSION constant replaced with $getID3->version()

vm’s picture

Title: Does not support latest 1.9.0 [2011-06-20] » Patch to allow getid3 module to work with version 1.9.0 of the getid3 library
Version: 6.x-1.x-dev » 7.x-1.x-dev
Category: task » feature

Patch works correct for 7.x-dev of getid3 module as well

vm’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Priority: Major » Normal

Scratch the last comment. There does seem to be an issue with using this patch with the D7 version. Working on more investigation.

vm’s picture

in D7 a Notice: Use of undefined constant GETID3_VERSION - assumed 'GETID3_VERSION' in getid3_get_version() (line 106 of /home/x/public_html/sites/all/modules/getid3/getid3.module) is encountered on admin/config/media/getid3 .

However, the 1.9.0 version of getid3 is indeed reported.

Line 106 is one of the lines introduced by this patch

anrikun’s picture

StatusFileSize
new1.15 KB

Ooops sorry for the missing single-quotes!
Here is an updated patch.

vm’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Tested and the new patch does indeed work with with 7.x-1.x-dev

anrikun’s picture

Feel free to mark this as RTBC then :-)

vm’s picture

Status: Needs review » Reviewed & tested by the community

Done

direcs’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Why is this patch then not integrated in the current 6.x version?
Worked fine for me. (I am not able to use D7, since the module ffpc is not D7 ready. :-( )

vm’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Because changes typically go into the the current -dev and are backported from there. Thus 7.x.

Note that the patch is the same for both versions 6.x and 7.x

Anonymous’s picture

StatusFileSize
new1.05 KB

My patch is similar, just a little bit simpler.

izmeez’s picture

subscribing

vm’s picture

Title: Patch to allow getid3 module to work with version 1.9.0 of the getid3 library » Patch attached - allow getid3 module to work with version 1.9.0 of the getid3 library

confirmed #14 also works for D7.x

vm’s picture

Category: feature » bug

marking as bug report since the current version of getid3 stable is 1.9.0

anrikun’s picture

@eriksen:
For future compatibility, I wonder if it is not better to stick to API. Changelog states:

1.9.0: [2011-06-20] James Heinrich »
¤ GETID3_VERSION constant replaced with $getID3->version()

So I guess $getID3->version() is the recommended API way to access version.

jvieille’s picture

#13 solved my issue. Thanks

endlasuresh’s picture

can somebody tell me how to use this patch i am getting confused where to put this code? I am using 1.9.1 version

vm’s picture

http://drupal.org/patch and child docs should aid.

Per the patches first line it is patching getid3.module

knalstaaf’s picture

I'm using 1.9.1 as well and #13 works fine for me.

To patch files put the patch in the module folder where it should be applied. On Mac I'm using the OpenTerminalHere app (<- navigate to the getID3 module folder and hit that button in your Finder) combined with this line in the popped up Terminal window:

patch -b < getid3.new-version-checker.patch

The Windows version of OpenTerminalHere can be found here I believe: http://www.petefreitag.com/item/146.cfm

drewish’s picture

Title: Patch attached - allow getid3 module to work with version 1.9.0 of the getid3 library » Allow getid3 module to work with version 1.9.0 of the getid3 library
Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
StatusFileSize
new1.6 KB

@eriksen.costa in #13 from the docs for defined():

If you want to see if a variable exists, use isset() as defined() only applies to constants. If you want to see if a function exists, use function_exists().

So it's simpler but it's misusing the function which might result in problems in later versions of PHP.

Side note it seems like we should change getid3_load() to return the object it's creating rather than a Boolean. It seems wasteful to instantiate the object twice.

I took anrikun's patch from #7 and switched the order since the method is the way of doing it going forward. Committed this to 7.x-1.x. If someone wants to create a new issue to bump the recommended version number to 1.9.1 feel free ;)

drewish’s picture

Status: Patch (to be ported) » Fixed

committed to 6.x-1.x and created releases for both branches.

drewish’s picture

Looks like there's already an issue for bumping the version but it's a bit dated: #886226: Bump suggested getID3 version to avoid Deprecated function eregi() warning

Status: Fixed » Closed (fixed)

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