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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | panopoly_widgets-spotlight-missing-images-2480835-1.patch | 1.71 KB | dsnopek |
Comments
Comment #1
dsnopekAttached 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
Comment #2
cboyden commentedThis is working as expected.
Comment #4
dsnopekThanks! Committing now..