Hi,

I'm not very good w/php so please forgive me if I speak in C++/Java eese.

In function _node_media_audio_gallery($node) logic tries to implement the following for loop:
foreach ($node->node_media[0] as $id=>$image)
However, it
bombs reporting an invalid argument to the foreach call as follows:

"warning: Invalid argument supplied for foreach() in ..../drupal/sites/all/modules/node_media/node_media.module on line 881."

The sound file is correctly uploaded to files/node_media.
There are no problems uploading video nor picture files in this manner.

The function itself has a $node passed in and falls through a "if (empty($node->node_media[2]))" without prompting the user to upload media thinking it has some media to loop through. I suspect the reference to the array might be lost or for some reason or element 2 != null while [0] is.

Let me know if I can help in any way. I am hacking away at this with my php reference in hand.
Bob Hanley
robert.hanley@comcast.net

thanks

Comments

develcuy’s picture

Version: 5.x-1.0-alpha1 » 5.x-1.x-dev

I have done a general review of code and committed changes. Please let know how does it goes now.

Blessings!

develcuy’s picture

Title: $Id: node_media.module,v 1.1.2.1 2008/06/06 05:31:17 develCuy Exp $ » Audio upload and Audio Gallery not implemented yet
robert_hanley’s picture

I'm sorry, but I can't find where you posted the changes...are they in CVS?
Can a general user like myself access them?

develcuy’s picture

@robert_hanley, changes are now packaged in "5.x-1.x-dev" version, the one with red background in project's home page. If you want CVS version, just do a checkout to "contributions/modules/node_media" more info, you don't need a user, just change your username with: "anonymous" instead of "cvs_username" or just nothing.

Blessings!

robert_hanley’s picture

Awsome, thanks much I'll try it our now. Sorry about the delay in response, my day job had me traveling a bit the past couple of weeks.
I'll update on success.

thanks

robert_hanley’s picture

Ok I applied the newer version and here's what I found:

As it was packaged it didn't work for me. However, I noticed that in function _node_media_audio_gallery in your global declarations you didn't declare a $_node_media_path. Once I declared such a path, the audio icons show up (since I had already attempted to upload 2 mp3s) along side the windows media player. Click play and the player plays the audio files. As for the video I had already uploaded there , click on the video gallery tab, the video icon shows up unharmed, click on the player's play button and it plays the video appropriately as well. All seems to be working. I will keep testing and see if there is anything I'm missing.

Thanks again for your responsiveness and fine work on this module!

robert_hanley’s picture

Status: Active » Closed (fixed)

This fix I noted above still works and hasn't broken anything in my testing. I'm satisfied.

thanks

develcuy’s picture

Thank you @robert_hanley :)