bug #4871 Error on creating table

Signed-off-by: Marc Delisle <marc@infomarc.info>
This commit is contained in:
Marc Delisle 2015-04-24 13:08:13 -04:00
parent 738b37477b
commit ff2fb74b35
2 changed files with 30 additions and 4 deletions

View File

@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog
- bug #4867 Incorrect ALTER TABLE statement generated
- bug #4870 Inconsistency in 'Ignore' checkbox in insert page
- bug #4869 Drop column action not asking to confirm
- bug #4871 Error on creating table
4.4.3.0 (2015-04-20)
- bug #4851 PHP errors in login dialogue

View File

@ -237,6 +237,30 @@ function PMA_getHtmlForTableFieldDefinitions($header_cells, $content_cells)
return $html;
}
/**
* Function to get html for the hidden fields containing index creation info
*
* @param string $index_type the index type
*
* @return string
*/
function PMA_getHtmlForHiddenIndexInfo($index_type)
{
$html = '<input type="hidden" name="' . $index_type . '" value="';
if (! empty($_REQUEST[$index_type])) {
// happens when an index has been set on a column,
// and a column is added to the table creation dialog
//
// this contains a JSON-encoded string
$html .= htmlspecialchars($_REQUEST[$index_type]);
} else {
$html .= '[]';
}
$html .= '">';
return $html;
}
/**
* Function to get html for the create table or field add view
*
@ -254,10 +278,11 @@ function PMA_getHtmlForTableCreateOrAddField($action, $form_params, $content_cel
. ($action == 'tbl_create.php' ? 'create_table' : 'append_fields')
. '_form ajax lock-page">';
$html .= PMA_URL_getHiddenInputs($form_params);
$html .= '<input type="hidden" name="primary_indexes" value="[]">';
$html .= '<input type="hidden" name="unique_indexes" value="[]">';
$html .= '<input type="hidden" name="indexes" value="[]">';
$html .= '<input type="hidden" name="fulltext_indexes" value="[]">';
$html .= PMA_getHtmlForHiddenIndexInfo('primary_indexes');
$html .= PMA_getHtmlForHiddenIndexInfo('unique_indexes');
$html .= PMA_getHtmlForHiddenIndexInfo('indexes');
$html .= PMA_getHtmlForHiddenIndexInfo('fulltext_indexes');
if ($action == 'tbl_create.php') {
$html .= PMA_getHtmlForTableNameAndNoOfColumns();