[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_0BETA2-1941-g589d918

Marc Delisle lem9 at users.sourceforge.net
Tue Feb 8 23:36:16 CET 2011


The branch, master has been updated
       via  589d918ee7e4e747ce55f2f0c0905bc8d6fe1dc9 (commit)
      from  677e5a5da74080c0b08d8ca3e159aedc82670e76 (commit)


- Log -----------------------------------------------------------------
commit 589d918ee7e4e747ce55f2f0c0905bc8d6fe1dc9
Author: Marc Delisle <marc at infomarc.info>
Date:   Tue Feb 8 17:36:05 2011 -0500

    Errors from the Ajax create table dialog where not displayed

-----------------------------------------------------------------------

Summary of changes:
 js/functions.js                  |    3 ++-
 libraries/tbl_properties.inc.php |    2 +-
 tbl_create.php                   |   16 ++++++++++------
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index 4fcfb1d..57b4644 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1743,6 +1743,7 @@ $(document).ready(function() {
         //User wants to submit the form
         $.post($form.attr('action'), $form.serialize() + "&do_save_data=" + $(this).val(), function(data) {
             if(data.success == true) {
+                $('#properties_message').html('');
                 PMA_ajaxShowMessage(data.message);
                 $("#create_table_dialog").dialog("close").remove();
 
@@ -1794,7 +1795,7 @@ $(document).ready(function() {
                 }
             }
             else {
-                PMA_ajaxShowMessage(data.error);
+                $('#properties_message').html(data.error);
             }
         }) // end $.post()
     }) // end create table form (save)
diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php
index 4bc1029..14e4936 100644
--- a/libraries/tbl_properties.inc.php
+++ b/libraries/tbl_properties.inc.php
@@ -786,7 +786,7 @@ if ($action == 'tbl_create.php') {
         />
 <?php } ?>
 </fieldset>
-
+<div id="properties_message"></div>
 </form>
 
 <div id="enum_editor">
diff --git a/tbl_create.php b/tbl_create.php
index 6d569b5..4d3171a 100644
--- a/tbl_create.php
+++ b/tbl_create.php
@@ -350,12 +350,16 @@ if (isset($_REQUEST['do_save_data'])) {
         }
         exit;
     } else {
-        PMA_mysqlDie('', '', '', $err_url, false);
-        // An error happened while inserting/updating a table definition.
-        // to prevent total loss of that data, we embed the form once again.
-        // The variable $regenerate will be used to restore data in libraries/tbl_properties.inc.php
-        $num_fields = $_REQUEST['orig_num_fields'];
-        $regenerate = true;
+        if ($GLOBALS['is_ajax_request'] == true) {
+            PMA_ajaxResponse(PMA_DBI_getError(), false);
+        } else {
+            PMA_mysqlDie('', '', '', $err_url, false);
+            // An error happened while inserting/updating a table definition.
+            // to prevent total loss of that data, we embed the form once again.
+            // The variable $regenerate will be used to restore data in libraries/tbl_properties.inc.php
+            $num_fields = $_REQUEST['orig_num_fields'];
+            $regenerate = true;
+        }
     }
 } // end do create table
 


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list