If there are no images added to a field using photoswipe then it throws the following javascript error.

uncaught exception: Code.PhotoSwipe.createInstance: No images to passed.

This causes other javascript on a page to fail such as Panel's in place editor. It looks like this is ultimately caused from the field creating an empty div when using photoswipe. Basically there is an empty field rendering out divs.

#1 remove_empty_element-1880684-1.patch788 bytessegovia94
Members fund testing for the Drupal project. Drupal Association Learn more


segovia94’s picture

Title: Javascript uncaught exception error if no images used » Empty field div creating javascript uncaught exception error
Status: Active » Needs review
788 bytes

Here is a patch that removes the empty divs from being created.

ParisLiakos’s picture

Status: Needs review » Fixed

thanks for the patch:)

Status: Fixed » Closed (fixed)

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