From b8df9c0cf5133e75fa4f62e0912df94da3ec6b7c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 17 Mar 2015 15:40:27 +0200 Subject: [PATCH] Use old clean key for endIPE command, when a new revision changes the clean key. --- panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php b/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php index c959a6d..e841fbe 100644 --- a/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php +++ b/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php @@ -277,6 +277,7 @@ class panels_renderer_ipe extends panels_renderer_editor { } // Otherwise it was submitted. + $old_clean_key = $this->clean_key; if (!empty($form_state['clicked_button']['#save-display'])) { // Saved. Save the cache. panels_edit_cache_save($this->cache); @@ -290,9 +291,12 @@ class panels_renderer_ipe extends panels_renderer_editor { panels_edit_cache_clear($this->cache); } + // Return the old clean key for the endIPE command, because when a new + // revision is created, the key gets changed, and the JS cannot find a + // editor with a new key, which causes the command not be executed at all. $this->commands[] = array( 'command' => 'endIPE', - 'key' => $this->clean_key, + 'key' => $old_clean_key, ); } -- 2.2.1