Download & Extend

E_STRICT notices on audio node creation

Project:Audio
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Shiny
Status:reviewed & tested by the community

Issue Summary

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

AttachmentSize
0001-fixed-some-E_STRICT-notices.patch1.68 KB

Comments

#1

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 : '');

#2

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.

#3

Status:needs work» needs review

Tested and works for me.

AttachmentSize
audio-6.x-1.0-unstable6_strict_2.patch 1.35 KB

#4

Status:needs review» reviewed & tested by the community

works

nobody click here