summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2009-07-18 00:47:40 (GMT)
committer Earl Miles2009-07-18 00:47:40 (GMT)
commitf3a4d677841bfdf0b80bead42c4f16c212bd2352 (patch)
tree7f296347dc83fa996a0878a8f7f87480d0699c44
parent4f33ed2ffe062cecaae6a526b075e3900f39fbd8 (diff)
#476440: Seriously, cloning variants really realy fixed.
-rw-r--r--page_manager/page_manager.admin.inc8
-rw-r--r--page_manager/page_manager.module2
2 files changed, 7 insertions, 3 deletions
diff --git a/page_manager/page_manager.admin.inc b/page_manager/page_manager.admin.inc
index eed47d0..e539925 100644
--- a/page_manager/page_manager.admin.inc
+++ b/page_manager/page_manager.admin.inc
@@ -1490,13 +1490,17 @@ function page_manager_handler_clone(&$form, &$form_state) {
* Clone an existing task handler into a new handler.
*/
function page_manager_handler_clone_submit($form, &$form_state) {
- $handler = $form_state['handler'];
+ $export = page_manager_export_task_handler($form_state['handler']);
+ ob_start();
+ eval($export);
+ ob_end_clean();
+
page_manager_handler_add_to_page($form_state['page'], $handler, $form_state['values']['title']);
$plugin = page_manager_get_task_handler($handler->handler);
// It has no forms at all. Add the variant and go to its first operation.
$keys = array_keys($plugin['operations']);
- $form_state['new trail'] = array('handlers', $name, reset($keys));
+ $form_state['new trail'] = array('handlers', $handler->name, reset($keys));
}
/**
diff --git a/page_manager/page_manager.module b/page_manager/page_manager.module
index e069876..97a9ac3 100644
--- a/page_manager/page_manager.module
+++ b/page_manager/page_manager.module
@@ -356,7 +356,7 @@ function page_manager_handler_get_name($task_name, $handlers, $handler) {
* This is used by both import and clone, since clone just exports the
* handler and immediately imports it.
*/
-function page_manager_handler_add_to_page(&$page, $handler, $title = NULL) {
+function page_manager_handler_add_to_page(&$page, &$handler, $title = NULL) {
$last = end($page->handler_info);
$handler->weight = $last ? $last['weight'] + 1 : 0;
$handler->task = $page->task_id;