diff --git a/includes/context.inc b/includes/context.inc index 6628b5f9a860eead5abb0c73f4021b981ae2e042..fbabac2a871680e091b1f80d2e8e46db9f7377b0 100644 --- a/includes/context.inc +++ b/includes/context.inc @@ -1127,9 +1127,12 @@ function ctools_context_get_context_from_context($context, $type = 'context', $a * @param $placeholders * If true, placeholders are acceptable. */ -function ctools_context_get_context_from_contexts($contexts, $type = 'context', $placeholders = FALSE) { +function ctools_context_get_context_from_contexts($contexts, $type = 'context', $placeholders = FALSE, $existing_contexts = array()) { $return = array(); foreach ($contexts as $context) { + if (!empty($existing_contexts)) { + $context['existing contexts'] = $existing_contexts; + } $ctext = ctools_context_get_context_from_context($context, $type); if ($ctext) { if ($placeholders) { @@ -1223,7 +1226,7 @@ function ctools_context_load_contexts($object, $placeholders = TRUE, $contexts = } if (!empty($object->contexts) && is_array($object->contexts)) { - $contexts += ctools_context_get_context_from_contexts($object->contexts, 'context', $placeholders); + $contexts += ctools_context_get_context_from_contexts($object->contexts, 'context', $placeholders, $contexts); } // add contexts from relationships