We've noticed a weird problem today, when one of my users ripped his songs from his CD using iTunes, and uploaded them, they ALL had question marks added at the end of the Artist / Title / etc fields, which caused pathauto to freak out completely.
The pathauto side of the issue is obviously for discussion elsewhere, but the cause of the issue appears to be these iTunes question marks being generated via getID3/audio module??
I should add that the MP3's ID3 tags when viewed directly in Winamp etc do not have visible question marks or any strange characters - only normal letters/words.
Any thoughts on this issue?
Comments
Comment #1
drewish commentedplease search for existing issues first. this is a duplicate of: http://drupal.org/node/156476 since there's about 10 other duplicates of it it should be easy to find ;)
Comment #2
mediafrenzy commentedOops! Sorry Drewish, I did search - though it was at 3am ...
Besides that, I didn't really know what to search for - as I didn't know it was a UTF-8 ID3 corruption issue... but point taken.
Comment #3
drewish commentedwhoops, i apologize, i directed you to the wrong issue. it should have been : http://drupal.org/node/145117
Comment #4
mediafrenzy commentedAh ok - but I see the quick fix that is given there is to use GetID3 1.7.7 .... which is the version I am already using?
Comment #5
mediafrenzy commentedThis is still happening, and I believe some others are having the same experience of this, despite using Get ID3 1.7.7 etc.
So just to clarify, the ARTIST and TITLE fields displayed on the audio page have a question mark added to them, which gets automatically added to the Page Title.
In my case at least, this then carries over into the pathauto module, breaking the page URL and causing a 404 to be displayed if the page is viewed. This breaking of the page URL effect wouldn't be the case if not using pathauto obviously.
Comment #6
BrianKlinger commentedSubscribing - same issue as mediafrenzy - I am using Drupal 5.7, getID3 1.7.7, latest Dev version of audio node (5.x-1.x-dev), and firefox.
I am getting a %00 character (I'm using pathauto, so %00 is what's showing up in the url), which if I understand correctly, is a NUL character, which is being replaced by the lovely diamond question mark (as described by mediafrenzy).
Comment #7
zirafa commentedI also see NUL characters placed in the middle of the tags. This was causing playlist feeds to break. As a workaround, I applied a patch that removed all NUL characters before output:
$output = str_replace("\0",'',$output);Comment #8
zirafa commentedJust to clarify, the patch and related thread is here: http://drupal.org/node/212913
Comment #9
mediafrenzy commentedThanks Zirafa - so we'd need to also upgrade our audio modules to 5.x-2.x-dev in order to apply that patch?
Comment #10
zirafa commentedThat patch wouldn't fix this issue, just the other issue with playlist feeds breaking.
However, I think a patch could be made that strips the NUL characters before saving the getid3 tags to the database, which might solve this problem too.
Comment #11
mediafrenzy commentedAh right I see.
If any coder reading this has a spare moment, we'd really appreciate someone crafting a patch for this issue :)
Comment #12
zirafa commentedHere, try this patch. I have not been able to duplicate this problem and test this patch but I suspect it might fix things. It basically strips the NUL characters from the tags before writing the id3 tags to the file/database.
This patch won't fix already uploaded files, but try re-uploading a file and see if it fixes it.
Comment #13
mediafrenzy commentedCool thanks very much zirafa, I'll test that out tomorrow and report back here whether that seems to nail it.
Comment #14
dnewkerk commentedTested the patch on version 5.x-1.3 and it worked fine. The extra ? after each metadata line is no longer present when uploading new audio files. Navigated through all audio pages and didn't experience any errors.
Thanks - hope you can include this now in the next version of the module.
Comment #15
BrianKlinger commentedI used the patch and it all works pretty well but I still have one problem. I use pathauto to name the url. My pathauto grabs the title of the node which is based on the id3 metadata, and apparently it grabs the title BEFORE the NUL characters are stripped, so the URL STILL has the NUL characters in it. The metadata and the title are correct when I edit the node (I can't just go to the node because the url is broken due to the NUL characters), so I have to resave the node for the url to grab the new title (I had to change how pathauto behaves in order to fix this problem). This certainly isn't critical and I've found a workaround, but it's still a bit of an inconvenience. If anyone can come up with a better solution, I'd love to test it/try it out.
Comment #16
McCool commentedI've reached a similar situation, but I think I've fixed it.
After making the change in the patch above , the meta tags appear OK, no longer any questions remark, but the title and therefore pathauto generated path, still have the problem. Stripping the \0 characters out at the point of reading the tags from the file seems to be the way forward.
So I edited the audio_read_id3tags() function in audio_getid3.module as follows.
I replaced this line (line 330 I think):
$ret['tags'][$key] = array_pop($value);with this:
$ret['tags'][$key] = array_pop(str_replace("\0", '', $value));It now seems to work fine for me.
Comment #17
sillygwailoAttached is a patch that incorporates both #12 and #16.
Comment #18
daveo commentedThanks very much Richard - this has caused me much extra fiddling when posting podcasts!
Comment #19
BrianKlinger commentedYup - fixes 12 and 16 (combined in 17) fixed my issues, as well! Thanks for the hard work, everyone!
Comment #20
drewish commentedthanks, committed to HEAD and DRUPAL-5.
Comment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.