Currently, the Spotlight widget assumes that each image exists when rendering. This is a safe assumption under normal circumstances because it's a required field on the settings form.

However, it's possible to remove files by going to "Content" -> "Files" (/admin/content/file) and removing them after the fact!

Doing so will cause a load of PHP notices and warnings:

Notice: Undefined index: description in theme_panopoly_spotlight_view() (line 375 of /var/aegir/prj/panopoly/panopoly_widgets/panopoly_widgets.spotlight.inc).
Notice: Undefined index: link in theme_panopoly_spotlight_view() (line 376 of /var/aegir/prj/panopoly/panopoly_widgets/panopoly_widgets.spotlight.inc).
Notice: Undefined index: alt in theme_panopoly_spotlight_view() (line 377 of /var/aegir/prj/panopoly/panopoly_widgets/panopoly_widgets.spotlight.inc).
Notice: Undefined index: uuid in theme_panopoly_spotlight_view() (line 381 of /var/aegir/prj/panopoly/panopoly_widgets/panopoly_widgets.spotlight.inc).
Notice: Trying to get property of non-object in theme_panopoly_spotlight_view() (line 382 of /var/aegir/prj/panopoly/panopoly_widgets/panopoly_widgets.spotlight.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of /var/aegir/platforms/panopoly-dev/includes/entity.inc).
Notice: Trying to get property of non-object in theme_panopoly_spotlight_view() (line 388 of /var/aegir/prj/panopoly/panopoly_widgets/panopoly_widgets.spotlight.inc).

It would be better if we skipped rendering slides that had missing images. Users can then edit the Spotlight widget and replace the image or delete the slide if necessary.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Status: Active » Needs review
FileSize
1.71 KB

Attached is a patch that fixes this in my testing! I'm going to run through Travis-CI in a moment.

EDIT: Here is the build on Travis: https://travis-ci.org/panopoly/panopoly/builds/60701727

cboyden’s picture

Status: Needs review » Reviewed & tested by the community

This is working as expected.

  • dsnopek committed 43703a7 on 7.x-1.x
    Update Panopoly Widgets for Issue #2480835 by dsnopek: Spotlight widget...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committing now..

Status: Fixed » Closed (fixed)

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