? 840344-node-add-argument-referring-to-no-longer-used-conf-array.patch ? 883902_ctools_remove_color_module_0.patch ? 894040-show-cancel-too-much.patch ? 900570-no-such-thing-as-expand.patch ? 905546-let-absolute-divs-be-clicked-on.patch ? 908104-6.patch ? 911396-1_fix_notice.patch ? 920266-panels-simple_cache-t.patch ? 922442_ctools_css_include_2.patch ? 931434.patch ? 941778-update-and-save-not-on-add-variant.patch ? 942968-tags-break-term-access-rule.patch ? 955348-no-redirect-causing-data-loss.patch ? 959206-guess-context-if-none-set.patch ? _ctools_css_disassemble_declaration_1.patch ? add-detach-to-modal-close.patch ? advanced-help-ctools-export-ui-1.patch ? ctools-358953-12.patch ? ctools-doc-error.patch ? ctools-redirect-options-1.patch ? ctools_css_disassemble.patch ? update-and-save-improvements.patch ? wizard.html_.patch Index: includes/content.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/content.inc,v retrieving revision 1.12.2.13 diff -u -p -r1.12.2.13 content.inc --- includes/content.inc 19 Aug 2010 20:35:03 -0000 1.12.2.13 +++ includes/content.inc 1 Nov 2010 20:38:56 -0000 @@ -747,6 +747,35 @@ function ctools_content_select_context($ return; } + // Deal with dynamic required contexts not getting updated in the panes. + // For example, Views let you dynamically change context info. While + // we cannot be perfect, one thing we can do is if no context at all + // was asked for, and then was later added but none is selected, make + // a best guess as to what context should be used. THis is right more + // than it's wrong. + if (is_array($subtype_info['required context'])) { + if (empty($conf['context']) || count($subtype_info['required context']) != count($conf['context'])) { + foreach($subtype_info['required context'] as $index => $required) { + if (!isset($conf['context'][$index])) { + $filtered = ctools_context_filter($contexts, $required); + if ($filtered) { + $keys = array_keys($filtered); + $conf['context'][$index] = array_shift($keys); + } + } + } + } + } + else { + if (empty($conf['context'])) { + $filtered = ctools_context_filter($contexts, $subtype_info['required context']); + if ($filtered) { + $keys = array_keys($filtered); + $conf['context'] = array_shift($keys); + } + } + } + if (empty($conf['context'])) { return; }