Edit summary should now be carried over when a draft is restored
authorDan
Tue, 12 Feb 2008 07:38:52 -0500
changeset 417 b76ebe229548
parent 416 53fcdf309a82
child 418 322fa0c91303
Edit summary should now be carried over when a draft is restored
ajax.php
includes/clientside/static/editor.js
--- a/ajax.php	Tue Feb 12 07:33:25 2008 -0500
+++ b/ajax.php	Tue Feb 12 07:38:52 2008 -0500
@@ -105,7 +105,7 @@
       if ( $src = $page->fetch_source() )
       {
         $allowed = true;
-        $q = $db->sql_query('SELECT author, time_id, page_text FROM ' . table_prefix . 'logs WHERE log_type = \'page\' AND action = \'edit\'
+        $q = $db->sql_query('SELECT author, time_id, page_text, edit_summary FROM ' . table_prefix . 'logs WHERE log_type = \'page\' AND action = \'edit\'
                                AND page_id = \'' . $db->escape($paths->page_id) . '\'
                                AND namespace = \'' . $db->escape($paths->namespace) . '\'
                                AND is_draft = 1;');
@@ -152,6 +152,7 @@
         if ( isset($_GET['get_draft']) && @$_GET['get_draft'] === '1' )
         {
           $return['src'] = $row['page_text'];
+          $return['edit_summary'] = $row['edit_summary'];
         }
       }
       
--- a/includes/clientside/static/editor.js	Tue Feb 12 07:33:25 2008 -0500
+++ b/includes/clientside/static/editor.js	Tue Feb 12 07:38:52 2008 -0500
@@ -910,6 +910,12 @@
         $('ajaxEditArea').setContent(response.src);
         $('ajaxEditArea').object.used_draft = true;
         
+        var es = document.getElementById('enano_editor_field_summary');
+        if ( es.value == '' )
+        {
+          es.value = response.edit_summary;
+        }
+        
         var dn = $('ajax_edit_draft_notice').object;
         dn.parentNode.removeChild(dn);
       }