diff --git a/import.php b/import.php index 72828e56fb..127d6e6292 100644 --- a/import.php +++ b/import.php @@ -785,6 +785,7 @@ if ($go_sql) { } $html_output = ''; + foreach ($sql_queries as $sql_query) { // parse sql query @@ -820,7 +821,7 @@ if ($go_sql) { $db, // db $table, // table null, // find_real_end - $_REQUEST['sql_query'], // sql_query_for_bookmark + null, // sql_query_for_bookmark - see below null, // extra_data null, // message_to_show null, // message @@ -836,6 +837,18 @@ if ($go_sql) { ); } + // sql_query_for_bookmark is not included in PMA_executeQueryAndGetQueryResponse + // since only one bookmark has to be added for all the queries submitted through + // the SQL tab + if (! empty($_POST['bkm_label']) && ! empty($import_text)) { + $cfgBookmark = PMA_Bookmark_getParams(); + PMA_storeTheQueryAsBookmark( + $db, $cfgBookmark['user'], + $_REQUEST['sql_query'], $_POST['bkm_label'], + isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null + ); + } + $response = PMA\libraries\Response::getInstance(); $response->addJSON('ajax_reload', $ajax_reload); $response->addHTML($html_output);