Had a couple errors about unproperly defined vars, patch coming in a day or two, these are fixed just not uploaded.

CommentFileSizeAuthor
#1 image_attach.module_node_211471.patch784 bytesstefgosselin

Comments

stefgosselin’s picture

Title: Undefined property: stdClass::$iid , in image » Undefined property: stdClass::$iid , in image_attach
Status: Active » Needs review
StatusFileSize
new784 bytes

* This just adds a simple isset() check, gets rid of a few undefined $node->iid errors I was having.

drewish’s picture

wouldn't if (!empty($node->iid)) { do the same thing?

drewish’s picture

whoops, looks like i just accidentally committed that last patch.

stefgosselin’s picture

Hey dre ! Both solutions would work, though semantically isset behaves as expected in all conditions, because isset() returns true if $iid is set to 0, whilst empty() returns false even if variable is SET to 0.

$iid is expected to have a non-zero value , so in this case both functions would fix the problem.

http://zainal.wordpress.com/2006/04/25/8/ <-- see here for code example.

drewish’s picture

yeah and in this case we're checking isset() and then evaluating it as a boolean. as far as i can tell !empty() does exactly the same thing.

drewish’s picture

Status: Needs review » Fixed

I committed some other fixes for this: http://drupal.org/cvs?commit=100539

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.