Skip to content

Commit

Permalink
Fix bug reported on pull request #14305
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
  • Loading branch information
laps15 committed May 30, 2018
1 parent 3df5e80 commit c021125
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -183,13 +183,14 @@ public function indexAction()
$columns = $this->dbi->getColumns($this->db, $this->table); $columns = $this->dbi->getColumns($this->db, $this->table);


$column_array = array(); $column_array = array();
$column_hash_array = array();
$column_array[''] = ''; $column_array[''] = '';
foreach ($columns as $column) { foreach ($columns as $column) {
if (strtoupper($this->tbl_storage_engine) == 'INNODB' if (strtoupper($this->tbl_storage_engine) == 'INNODB'
|| ! empty($column['Key']) || ! empty($column['Key'])
) { ) {
$column_array[$column['Field']] = $column['Field']; $column_array[$column['Field']] = $column['Field'];
$column_array[$column['Field'] . '_hash'] = md5($column['Field']); $column_hash_array[$column['Field']] = md5($column['Field']);
} }
} }
if ($GLOBALS['cfg']['NaturalOrder']) { if ($GLOBALS['cfg']['NaturalOrder']) {
Expand All @@ -208,6 +209,7 @@ public function indexAction()
? $this->existrel_foreign['foreign_keys_data'] : array(), ? $this->existrel_foreign['foreign_keys_data'] : array(),
'options_array' => $this->options_array, 'options_array' => $this->options_array,
'column_array' => $column_array, 'column_array' => $column_array,
'column_hash_array' => $column_hash_array,
'save_row' => array_values($columns), 'save_row' => array_values($columns),
'url_params' => $GLOBALS['url_params'], 'url_params' => $GLOBALS['url_params'],
'databases' => $GLOBALS['dblist']->databases, 'databases' => $GLOBALS['dblist']->databases,
Expand Down
2 changes: 1 addition & 1 deletion templates/table/relation/common_form.twig
Expand Up @@ -117,7 +117,7 @@
{% set myfield = save_row[i]['Field'] %} {% set myfield = save_row[i]['Field'] %}
{# Use an md5 as array index to avoid having special characters {# Use an md5 as array index to avoid having special characters
in the name attribute (see bug #1746964 ) #} in the name attribute (see bug #1746964 ) #}
{% set myfield_md5 = column_array[myfield ~ '_hash'] %} {% set myfield_md5 = column_hash_array[myfield] %}


{% set foreign_table = false %} {% set foreign_table = false %}
{% set foreign_column = false %} {% set foreign_column = false %}
Expand Down

0 comments on commit c021125

Please sign in to comment.