Here's a starting point for upgrading the module to the new Forms API. It still needs quite a bit of work.

The file is lost after previews but, heck, that's still a problem with the project module. I've heard that there are some updates to the file and upload modules to provide support for this.

Comments

drewish’s picture

If you're interested in using this patch I'll keep it up to date. If you're planning on doing the conversion youself let me know and I'll just use it internally until you make it official.

drewish’s picture

StatusFileSize
new23.65 KB

oh, who am i kididng. i'm a patch whore. i do think it would make sense to move the files back end to the attachment module though. getting the preview working is a real pain in the ass. i'd rather let someone else figure it out.

q0rban’s picture

This patch doesn't work for me on the current version of audio.module... I get a bunch of rejected code...

-james

drewish’s picture

StatusFileSize
new23.66 KB

i'm not sure why it wasn't working for you but i've re-rolled it. give it a try and let me know if it works for you.

q0rban’s picture

Thanks, it works now, but I think it was an issue with Diff'nPatch... I'm not too crazy about that program.. I'm going to install it on a test site and start working with it... Should I post bugs I find in this node, or start a new bug?

cheers

Colin Brumelle’s picture

Thanks guys! Lets keep bug reports relating to the forms API in this thread.

q0rban’s picture

Is there a reason you left out the title field in the audio_form function? Seems a bit weird only having a description textarea, without a title...

Also, on clicking submit I receive an error:

Could not load the MP3.
inspiredbylife’s picture

> Is there a reason you left out the title field in the audio_form function? Seems a bit weird only having a description textarea, without > a title...

May be a side effect of the new forms API in 4.7? The 'title' field is no more inserted by default in 4.7 I guess.

q0rban’s picture

StatusFileSize
new23.22 KB

Hmm... in that case, I'll submit a new patch... I'm not sure if I did it right, but here goes...

q0rban’s picture

Also, it appears that the error I'm getting occurs in the getID3.php file.. After doing a little digging I found that the actual error is:
unable to determine file format

I've tried uploading various files, 128 kbps, ID3v1 and v2, so I'm not sure what the problem is here...

drewish’s picture

it's been a while since i did the original work on the module but if i recall correctly, i didn't add a title field because it was supposed to be based on the meta data... i think having a separate title might be the better way to go. i'll take a look at your patch.

also, there seem to be some bugs in the getid3 package. i'm running into one where it can't load the id3tag writer...

q0rban’s picture

also, there seem to be some bugs in the getid3 package. i'm running into one where it can't load the id3tag writer...

could this be due to PHP5 errors? I see that getID3 is a PHP4 script

drewish’s picture

I'm sick of trying to work with the files table directly. I've been working on using the filemanager module instead. If someone wants to backport from that code let me know, I'd be happy to advise you.

Bèr Kessels’s picture

Yet another chance to plug my initiative, betteruplaod :) I am not the only one who is annoyd with drupal's limited media/file abilities: http://drupal.org/project/betterupload http://www.webschuur.com/node/246.

drewish’s picture

ber, i think something needs to be done to improve upload, mostly with previewing, but i'm pretty satisfied with the filemanger module. when you add in the attachment module, it does the same thing as upload, but leaves the backend open for use by other modules.

i think you'll have your work cut out for you with betterupload but i believe you're up to the task. i'd encourage you to take a close look at the filemanagermodule to learn what they've done right.

drewish’s picture

Status: Needs work » Closed (fixed)

I'm going to close this out, all the action is happening over here.