Patch #3500882 Fixing checkbox behaviour while editing identical rows

This commit is contained in:
Atul Pratap Singh 2012-04-22 06:53:54 -04:00 committed by Marc Delisle
parent bdd4fbb9f9
commit 00ca858181
3 changed files with 13 additions and 6 deletions

View File

@ -2915,9 +2915,9 @@ function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, $where_cla
$ret .= 'class="' . $class . '"';
}
$ret .= ' class="center">'
. '<input type="checkbox" id="id_rows_to_delete' . $row_no . $id_suffix . '" name="rows_to_delete[' . $where_clause_html . ']"'
. '<input type="checkbox" id="id_rows_to_delete' . $row_no . $id_suffix . '" name="rows_to_delete[' . $row_no . ']"'
. ' class="multi_checkbox"'
. ' value="' . htmlspecialchars($del_query) . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />'
. ' value="' . $where_clause_html . '" ' . (isset($GLOBALS['checkall']) ? 'checked="checked"' : '') . ' />'
. '<input type="hidden" class="condition_array" value="' . htmlspecialchars(json_encode($condition_array)) . '" />'
. ' </td>';
}

View File

@ -167,7 +167,8 @@ if (!empty($submit_mult) && !empty($what)) {
foreach ($selected AS $idx => $sval) {
switch ($what) {
case 'row_delete':
$full_query .= htmlspecialchars($sval)
$full_query .= 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)
. ' WHERE ' . urldecode($sval) . ' LIMIT 1'
. ';<br />';
break;
case 'drop_db':
@ -250,7 +251,13 @@ if (!empty($submit_mult) && !empty($what)) {
$_url_params['table']= $table;
}
foreach ($selected as $idx => $sval) {
$_url_params['selected'][] = $sval;
if ($what == 'row_delete'){
$_url_params['selected'][] = 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)
. ' WHERE ' . urldecode($sval) . ' LIMIT 1;';
}
else {
$_url_params['selected'][] = $sval;
}
}
if ($what == 'drop_tbl' && !empty($views)) {
foreach ($views as $current) {

View File

@ -69,7 +69,7 @@ if (!empty($submit_mult)) {
// indicating WHERE clause. Then we build the array which is used
// for the tbl_change.php script.
$where_clause = array();
foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) {
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
$where_clause[] = urldecode($i_where_clause);
}
@ -86,7 +86,7 @@ if (!empty($submit_mult)) {
// indicating WHERE clause. Then we build the array which is used
// for the tbl_change.php script.
$where_clause = array();
foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) {
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
$where_clause[] = urldecode($i_where_clause);
}