Index: components/views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/patterns/components/views.inc,v retrieving revision 1.1.2.2.2.4 diff -u -r1.1.2.2.2.4 views.inc --- components/views.inc 14 Apr 2009 23:30:18 -0000 1.1.2.2.2.4 +++ components/views.inc 5 May 2009 04:45:10 -0000 @@ -243,13 +243,13 @@ $form_data[] = &$match['item']; } // Get a list of items and determine if there is one to update - else if ($match['item']['id'] && !$view->get_item($parent[0]['key'], $match['item']['type'], $match['item']['id'])) { + else if ($match['item']['id'] && !$view->get_item($parent[0]['item']['display_id'], $match['item']['type'], $match['item']['id'])) { $form_ids[] = 'views_ui_add_item_form'; $form_data[] = &$match['item']; } else { unset($match['item']['id']); - $items = $view->get_items($match['item']['type'], $parent[0]['key']); + $items = $view->get_items($match['item']['type'], $parent[0]['item']['display_id']); $split = explode('.', $match['item']['name']); foreach($items as $key => $item) { if ($item['table'] == $split[0] && $item['field'] == $split[1]) { @@ -264,6 +264,11 @@ } } } + elseif ($match['item']['action'] == 'remove') { + $form_ids[] = 'views_ui_config_item_form'; + $match['item']['op'] = t('Remove'); + $form_data[] = &$match['item']; + } if ($match['item']['data']) { $form_ids[] = 'views_ui_config_item_form'; @@ -341,6 +346,12 @@ else { $display_id = $copy['display_id']; + if (!empty($copy['override']) && $view) { + $view->init_display(); + $display = &$view->display[$display_id]; + $display->handler->options_override(array(), $copy); + } + // Build the arg and values list if ($id == 'views_ui_edit_display_form') { $args = array($copy['section']); @@ -376,6 +387,8 @@ } else { $values = array('options' => $copy['data']); + $values = array_merge($copy, array('options' => $copy['data'])); + unset($values['data']); } } else {