When previewing a node before insert, i got an error in foreach on line 69.

I changed:

$node = node_load($element['#item']['nid']);

to:

$node = isset($element['#item']['nid']) ? node_load($element['#item']['nid']) : $element['#node'];

If you have a maximum number of images, and only use a few of them, all slots were displaying, the remainder with broken images.
I changed:

$output .= theme('imagecache', $preset, $image['filepath'], $image['data']['alt'], $image['data']['title']);

to:

$output .= is_numeric($image['fid']) ? theme('imagecache', $preset, $image['filepath'], $image['data']['alt'], $image['data']['title']) : '';

Comments

kbalderson’s picture

StatusFileSize
new1.18 KB

Dont know if patch got uploaded. Also, sorry if this is a duplicate of some issues, just wanted to help out, but am myself on a tight timeline.

carsonblack’s picture

Status: Needs review » Patch (to be ported)
StatusFileSize
new998 bytes

I had the same issue. I was experiencing this when I had a node that did not have any images associated with it. This is something that is allowed by my particular use case.

The error message I received was:
warning: Invalid argument supplied for foreach() in {PATH}/sites/all/modules/jquery_slideshow/jquery_slideshow.module on line 69.

The reason for this is that the node array is empty. So i just added a little if statement to check to make sure there was something in there before the foreach. The diff is attached.

Thanks for your work and creating this module!