I really hope someone can help me with this strange issue.

I'll try to be as concise as possible while giving possibly critical info.

I need to add an mp3 file to my website on a weekly basis.
I followed the tutorial for the MP3 Player module. I added a new content type called "audio", made sure I had CCK FileField enabled, and setup the wordpress player and necessary settings. I successfully created one audio node which consisted of a title and mp3 file. Great!

I moved on to developing other parts of the site. Then, I went back yesterday and decided to add a date field to the "audio" content type so that I could sort based on an entered date (as opposed to post date) since I was going to be posting content out of order. I have the date module installed... I created a new date field. Went back to my first audio node and editted it to include the new date field. Everything is great.

Then I went to add another audio node, file upload failed. field_audio_0 - This seemed strange... I'm guessing "0" is some kind of count... this wasn't my first entry, so it shouldn't be "0" right? I decided to create a new content type called "sound" created a new field to store the mp3... Tried creating content... mp3 uploads, but isn't there when I go back to view or edit my content. Went back and tried to create an "audio" content node... now the mp3 is uploading, but same problem with it not attaching itself to the node. I can see the .mp3 file in my /files directory, so I know it's uploading... but it's not even listed when I go to view or edit my content???

What did I do?

Comments

jon nunan’s picture

Just a couple notes so you don't spend too long searching for some things over others.

file upload failed. field_audio_0 - This seemed strange... I'm guessing "0" is some kind of count... this wasn't my first entry, so it shouldn't be "0" right?

I've had errors like this appear when I hit the upload button on the node form. Something goes wrong with the AJAX response in some browsers. Try using another browser or not hitting the 'upload' button next to the file. As long as you have browsed to hit, hitting save on the form will upload it, and you won't have to worry about AJAX errors.

The '0' is a count, but its not a global count. When setting up the field you would have had an option to choose how many values you want the field to save. I think it defaults to '1', but you could have selected to have uploaded '2','3'.. unlimited mp3's per node. Most code arrays are 0-based so that was just indicating it was the first audio field for that node in particular.

back to troubleshooting....
If you have the devel module installed try looking at the 'dev render' tab and drilling down the node. Does the field_audio entry have the filepath in it if you drill down to it?

Check your field renderers: Admin > Content > Content Types > Audio > Manage Fields > Display Fields Check you haven't hit the 'exclude' checkbox and that you have the right renderer selected.

njacobson’s picture

Thanks for the explanation on the count... I am limiting 1 mp3 per node - so it makes sense that every upload would have the field_audio_0 value.

I've been using firefox. I tried just browsing to the mp3 and clicking Save without clicking the "upload" button. This had the same outcome. File uploaded, but it's not attached to the audio node.

I tried IE using both methods. 1st, clicking the upload button. 2nd, browsing and clicking Save. Upload successful both times but not attached.

Any ideas on how to fix this? Should I just completely delete the "audio" content type, remove the mp3 and filefield module and start over?

njacobson’s picture

I went ahead and disabled the module, deleted all content types and fields associated with the mp3 player. Deleted the module from my server. Re-uploaded it, went through the whole process of setting it up... same problem! The system did seem to save all of my mp3 player settings (didn't have to go back and change the width or color's)... but it's still not working. :(

mcfilms’s picture

As long as you are starting over, might I suggest Embedded Media Field. I have tried it for video and love it.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

njacobson’s picture

the demo doesn't seem to work - showing how audio is added? Just from quickly browsing the project page, it looks like the audio is hosted someplace else??? Is that correct?

mcfilms’s picture

You know what, I'm sorry. You are right. I was just coming off a "win" using emfield and my enthusiasm led me to NOT pay attention closely to your problem. You want to upload the audio. Sorry if I led you down a dead end.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

njacobson’s picture

looking through the info on the dev render tab... I found the "content" section. Within that I found my two custom fields. Both say (Array, 6 elements)

In drilling deeper... I don't see anything specific to my mp3 file? What am I looking for?

Thanks!

jon nunan’s picture

Should be fields called filename and filepath. Either of them have any value?

njacobson’s picture

under "content" I have
body
field_dateservice (my custom entered date field)
field_sound (my file field for adding an mp3)
#pre_render
#content_extra_fields

under "field_sound" I have
field
#type
#title
#field_name
#access
#label_display
#node
#teaser
#page
#context
#single
items (Array, 0 elements)
#weight
#post_render
#field_name
#type_name
#context

none of these have my filename.mp3 or the path that the file is saved.

I did find that If I edit my content, reselect the date and reupload the mp3, it works fine. Sucks to upload twice though!

jon nunan’s picture

Sorry I can't be of more help, that's a real head scratcher, under

items (Array, 0 elements)

It should've been (Array, 1 element) if it worked, and drilling down on that would list filepaths etc...

Have you tried the exact same site on another host (or even local)? Does it do the same there? If it works elsewhere it would suggest a server config problem. If the same problem happens in different environments then it does indeed look like a bug in some code.

njacobson’s picture

I have not had a chance to set this up locally to see if I have the same issue, but I think I did find something. I tried to enter a new calendar event today, and noticed that my popup calendar selection is not working (wasn't working for my audio content either) I went ahead and entered it manually and saved. Same issue. The content was created, but the date and the body of my content did not save. When I edited and re-entered the date and body, it worked. So I'm guessing the date field is the culprit!

I'll take a look at my permissions and maybe try uninstalling and reinstalling the date module.

njacobson’s picture

I found that on my first entry - It only saves 1 of 3 fields. I enter a date, the title, and upload the mp3 file... and it only saves the title. If I go back and edit the content, renter the date, and reupload the audio, it saves.

This works, but is very annoying because my audio files are around 12MB and I have to upload them twice to get it to work.

njacobson’s picture

After figuring out that the problem was more than the mp3 module, more than the date module... I did some more research and found that it seems to be a CCK/trigger conflict. Once I disabled Triggers, my problems went away. I had this enabled because I had started working on the the schedular module to send out automatic newsletter emails... not sure if I will be able to do that now... but that was the issue in case anyone happens upon this.