notice: Undefined property: stdClass::$audio_tags in /home/br3nda/projects/drupal/sites/all/modules/audio/audio.module on line 816.
notice: Undefined property: stdClass::$audio_images in /home/br3nda/projects/drupal/sites/all/modules/audio/audio.module on line 817.
warning: Invalid argument supplied for foreach() in /home/br3nda/projects/drupal/sites/all/modules/audio/audio.module on line 551.

patch attached

Comments

drewish’s picture

Status: Needs review » Needs work

Thanks for the patch. Noticed a couple of small issues though.

I think we should probably be using an isset() or !empty() here to avoid the warning rather than is_array():

+  if (is_array($node->audio_tags)) {

shouldn't have a space between isset and the parens:

+    $form_state['values']['audio_tags'] = (isset ($node->audio_tags) ? $node->audio_tags : '');
+    $form_state['values']['audio_images'] = (isset ($node->audio_images) ? $node->audio_images : '');
rajaito’s picture

oh man... I am getting this error on a fresh install of Drupal 6.14 with Audio 6.x-1.x-dev:

warning: Invalid argument supplied for foreach() in /home/br3nda/projects/drupal/sites/all/modules/audio/audio.module on line 551.

But I have no idea to apply your patch. I looked up patching on Drupal but its a bit beyond my level of expertise. What confuses me, is that I used Audio on another Drupal site on the same server without this error.

HorsePunchKid’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Tested and works for me.

Shiny’s picture

Status: Needs review » Reviewed & tested by the community

works