diff --git a/plugins/contexts/string.inc b/plugins/contexts/string.inc index e731ab7..925c59c 100644 --- a/plugins/contexts/string.inc +++ b/plugins/contexts/string.inc @@ -47,8 +47,14 @@ function ctools_context_create_string($empty, $data = NULL, $conf = FALSE) { } if ($data !== FALSE ) { - // Support the array storage from the settings form but also handle direct input from arguments. - $context->data = is_array($data) ? $data['string'] : $data; + // Support both scalar storage from the settings form but also handle direct input from arguments. + $context->data = NULL; + if (is_scalar($data)) { + $context->data = $data; + } + elseif (isset($data['string'])) { + $context->data = $data['string']; + } $context->title = ($conf) ? check_plain($data['identifier']) : check_plain($data); return $context; }