Skip to content

Commit

Permalink
fixed with selected-change bug
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinaa committed May 16, 2012
1 parent f5c779d commit a624d84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
18 changes: 9 additions & 9 deletions libraries/insert_edit.lib.php
Expand Up @@ -44,17 +44,17 @@ function PMA_getFormParametersForInsertForm($paramArray, $where_clauses, $where_
* Retrieve the values for pma edit mode
*
* @param array $paramArray array containing $db and $table
* @param boolean $found_unique_key boolean variable for unique key
* @param array $where_clause where clauses
*
* @return array containing insert_mode,whereClauses, result array
* where_clauses_array and found_unique_key boolean value
*/
function PMA_getValuesForEditMode($paramArray)
function PMA_getValuesForEditMode($paramArray, $where_clause)
{
$found_unique_key = false;
list($table, $db) = $paramArray;
if (isset($_REQUEST['where_clause'])) {
$where_clause_array = PMA_getWhereClauseArray();
if (isset($where_clause)) {
$where_clause_array = PMA_getWhereClauseArray($where_clause);
list($whereClauses, $resultArray, $rowsArray, $found_unique_key)
= PMA_analyzeWhereClauses($where_clause_array, $paramArray, $found_unique_key);
return array(false, $whereClauses, $resultArray, $rowsArray, $where_clause_array, $found_unique_key);
Expand All @@ -68,13 +68,13 @@ function PMA_getValuesForEditMode($paramArray)
*
* @return whereClauseArray array of where clauses
*/
function PMA_getWhereClauseArray()
function PMA_getWhereClauseArray($where_clause)
{
if(isset ($_REQUEST['where_clause'])) {
if (is_array($_REQUEST['where_clause'])) {
return $_REQUEST['where_clause'];
if(isset ($where_clause)) {
if (is_array($where_clause)) {
return $where_clause;
} else {
return array(0 => $_REQUEST['where_clause']);
return array(0 => $where_clause);
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions tbl_change.php
Expand Up @@ -32,18 +32,17 @@
if (isset($_REQUEST['where_clause'])) {
$where_clause = $_REQUEST['where_clause'];
}

if (isset($_SESSION['edit_next'])) {
$where_clause = $_SESSION['edit_next'];
unset($_SESSION['edit_next']);
$after_insert = 'edit_next';
}
if (isset($_REQUEST['ShowFunctionFields'])) {
$cfg['ShowFunctionFields'] = $_REQUEST['ShowFunctionFields'];
}
if (isset($_REQUEST['ShowFieldTypesInDataEditView'])) {
$cfg['ShowFieldTypesInDataEditView'] = $_REQUEST['ShowFieldTypesInDataEditView'];
}

/**
* file listing
*/
Expand Down Expand Up @@ -149,7 +148,7 @@
$paramTableDbArray = array($table, $db);
//Retrieve values for data edit view
list($insert_mode, $where_clauses, $result, $rows, $where_clause_array, $found_unique_key)
= PMA_getValuesForEditMode($paramTableDbArray);
= PMA_getValuesForEditMode($paramTableDbArray, $where_clause);

// Copying a row - fetched data will be inserted as a new row, therefore the where clause is needless.
if (isset($_REQUEST['default_action']) && $_REQUEST['default_action'] === 'insert') {
Expand Down

0 comments on commit a624d84

Please sign in to comment.