summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValery L. Lourie2012-12-03 16:52:28 (GMT)
committer Valery L. Lourie2012-12-03 16:52:28 (GMT)
commit97a86dfb5ca35474e135825ac4c3a3e0775c7c0f (patch)
tree5caf577abb42db97f17b4178a36159c64cae118c
parentccda9157720c48ad692761baa2370ab4e5c4985f (diff)
Issue 1527006 by dDoak,valthebald: Fix invalid argument supplied for foreach()
-rw-r--r--metatags_quick.module4
1 files changed, 4 insertions, 0 deletions
diff --git a/metatags_quick.module b/metatags_quick.module
index c6e9d50..daae406 100644
--- a/metatags_quick.module
+++ b/metatags_quick.module
@@ -453,6 +453,10 @@ function metatags_quick_field_widget_form(&$form, &$form_state, $field, $instanc
if (isset($items[$delta]['metatags_quick']) && !is_array($items[$delta]['metatags_quick'])) {
$items[$delta]['metatags_quick'] = explode(',', $items[$delta]['metatags_quick']);
}
+ if ($items[$delta]['metatags_quick'] === NULL) {
+ $default_checkboxes = explode(',', $instance['settings']['options']);
+ $items[$delta]['metatags_quick'] = array_fill_keys($default_checkboxes, '');
+ }
$addition = array(
'#type' => 'checkboxes',
'#options' => drupal_map_assoc(isset($instance['settings']['options']) ? explode(',', $instance['settings']['options']) : array('noindex', 'nofollow')),