Skip to content

Instantly share code, notes, and snippets.

@ThomasHambach
Last active December 23, 2015 07:59
Show Gist options
  • Save ThomasHambach/6604182 to your computer and use it in GitHub Desktop.
Save ThomasHambach/6604182 to your computer and use it in GitHub Desktop.
When trying to create images with the devel generate module and having the module Image Field Caption enabled, you will get an error. This patch should resolve the issue.
Index: image_field_caption.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- image_field_caption.module (date 1379394208000)
+++ image_field_caption.module (revision )
@@ -213,6 +213,10 @@
$items = (array) $entity->{$field_name}[$langcode];
$delta_count = 0;
foreach ($items as $delta => $item) {
+ // Make sure we have a value.
+ if (!isset($item['image_field_caption'])) {
+ continue;
+ }
// We now know we have someting to insert.
$do_insert = TRUE;
$record = array(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment