diff --git a/plugins/display_renderers/panels_renderer_editor.class.php b/plugins/display_renderers/panels_renderer_editor.class.php index 6c1fce6..be075f2 100644 --- a/plugins/display_renderers/panels_renderer_editor.class.php +++ b/plugins/display_renderers/panels_renderer_editor.class.php @@ -726,8 +726,9 @@ class panels_renderer_editor extends panels_renderer_standard { // If $rc is FALSE, there was no actual form. if ($output === FALSE || !empty($form_state['complete'])) { - $pane = $this->cache->new_pane; - unset($this->cache->new_pane); + // Get the pane from the form_state. + // Without form_cache it would be automatically in there because it was a reference. + $pane = $form_state['pane']; // Add the pane to the display $this->display->add_pane($pane, $region); @@ -784,12 +785,17 @@ class panels_renderer_editor extends panels_renderer_standard { $output = ctools_content_form('edit', $form_info, $form_state, $content_type, $pane->subtype, $subtype, $pane->configuration, $step); + // If $rc is FALSE, there was no actual form. if ($output === FALSE || !empty($form_state['cancel'])) { // Dismiss the modal. $this->commands[] = ctools_modal_command_dismiss(); } else if (!empty($form_state['complete'])) { + // Get the pane from the form_state. + // Without form_cache it would be automatically in there because it was a reference. + $this->cache->display->content[$pid] = $form_state['pane']; + panels_edit_cache_set($this->cache); $this->command_update_pane($pid); $this->commands[] = ctools_modal_command_dismiss();