diff --git includes/context-admin.inc includes/context-admin.inc index 1676576..9cd46b0 100644 --- includes/context-admin.inc +++ includes/context-admin.inc @@ -403,12 +403,20 @@ function ctools_context_ajax_item_add($mechanism = NULL, $type = NULL, $cache_ke ctools_cache_operation($mechanism, $cache_key, 'finalize', $object); // Very irritating way to update the form for our contexts. - $arg_form_state = array('values' => array()); + $arg_form_state = array( + 'values' => array(), + 'programmed' => FALSE, + 'process_input' => FALSE, + 'complete form' => TRUE, + ); $arg_form = array( '#post' => array(), '#programmed' => FALSE, '#tree' => FALSE, + '#id' => $cache_key, + '#array_parents' => array(), + '#parents' => array(), ); // Build a chunk of the form to merge into the displayed form @@ -433,6 +441,9 @@ function ctools_context_ajax_item_add($mechanism = NULL, $type = NULL, $cache_ke '#post' => array(), '#programmed' => FALSE, '#tree' => FALSE, + '#id' => $cache_key . 'rel', + '#array_parents' => array(), + '#parents' => array(), ); $rel_form['relationship'] = array( @@ -564,6 +575,9 @@ function ctools_context_ajax_item_edit($mechanism = NULL, $type = NULL, $cache_k '#post' => array(), '#programmed' => FALSE, '#tree' => FALSE, + '#id' => $cache_key, + '#array_parents' => array(), + '#parents' => array(), ); // Build a chunk of the form to merge into the displayed form @@ -594,8 +608,8 @@ function ctools_context_ajax_item_edit($mechanism = NULL, $type = NULL, $cache_k function ctools_context_get_defaults($plugin_definition) { $conf = array( - 'identifier' => $plugin_definition['title'] . ($id > 1 ? ' ' . $id : ''), - 'keyword' => ctools_get_keyword($object, $plugin_definition['keyword']), + 'identifier' => $plugin_definition['title'], + 'keyword' => $plugin_definition['keyword'], 'name' => $plugin_definition['name'], ); @@ -630,7 +644,6 @@ function ctools_edit_context_form_defaults($form, &$form_state) { $object = $form_state['object']; $plugin_definition = $form_state['plugin']; $type_info = $form_state['type info']; - $position = $form_state['position']; $contexts = $form_state['contexts']; $conf = $form_state['conf']; @@ -780,4 +793,3 @@ function ctools_get_keyword($page, $word) { } return $keyword; } -