Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3955 (ok 4.0.5) Enum with umlauts break editing

4.0.2
fixed
Marc Delisle
None
1
2013-11-16
2013-05-23
Oliver Schlag
No

If you create a table with for example 5 fields and have one of them an enum with for example the values 'foo', 'bar', 'foobar', 'bär' you can no longer edit a whole record. It will stop rendering the edit fields after the enum value 'foobar'. Even the value 'bär' is not added to the dropdown.

The footer of the table is added to the edit table, so you can save your record. (see attachment).

1 Attachments

Discussion

  • Oliver Schlag
    Oliver Schlag
    2013-05-23

    Additional information:

    If i reload the whole window then the fields are all rendered correctly - except of the umlaut, which seems not correctly encoded.

    Browser cache is disabled.

     
  • Oliver Schlag
    Oliver Schlag
    2013-05-23

    The following fixed the problem for me, but perhaps there are some side effects. So someone hast to check this.

    --- libraries/insert_edit.lib.orig.php 2013-05-23 10:31:19.000000000 +0200
    +++ libraries/insert_edit.lib.php 2013-05-23 10:29:39.000000000 +0200
    @@ -888,10 +888,22 @@ function PMA_getColumnEnumValues($column
    {
    $column['values'] = array();
    foreach ($extracted_columnspec['enum_set_values'] as $val) {
    - $column['values'][] = array(
    - 'plain' => $val,
    - 'html' => htmlspecialchars($val),
    - );
    +
    + if(mb_detect_encoding($val, 'UTF-8') === 'UTF-8'){
    +
    + $column['values'][] = array(
    + 'plain' => utf8_encode($val),
    + 'html' => htmlspecialchars(utf8_encode($val)),
    + );
    +
    + } else {
    +
    + $column['values'][] = array(
    + 'plain' => $val,
    + 'html' => htmlspecialchars($val),
    + );
    +
    + }
    }
    return $column['values'];
    }

     
  • Brad Jorgensen
    Brad Jorgensen
    2013-05-23

    I'm having trouble recreating the problem. Can you create the problem on the dev test server so I can see it? It's at http://demo.phpmyadmin.net/master . The username is root and there is no password.

     
  • I also have this problem here (with 4.0.2)
    The same also applies to SET-fields with umlauts, with the patch above (and a similar patch in PMA_getColumnSetValueAndSelectSize) it works for me, too.
    However, I was unable to reproduce the problem on demo.phpmyadmin.net (on master and on STABLE), so it probably has sth to do with the php-configuration and/or php-version (my server still runs Debian-squeeze, so PHP is 5.3.3-7+squeeze15)

    Maybe I'll try to reproduce that on a more current system....

     
  • Oliver Schlag
    Oliver Schlag
    2013-05-31

    I can not reproduce this on demo.phpmyadmin.net/master/ too and we're still on 5.2.6-1+lenny16.

     
  • It seems to actually be version-specific. I just tried it on another system, mostly debian testing, with php 5.4 with debian's phpmyadmin-package (which is 4.0.1). There enums with umlauts are no problem.

    Another note: on my squeeze-server, the failure is a bit different from: I get no form at all, instead of a half rendered form like in the screenshot. When I click on an "edit row"-link, the ajax requests returns with message=null (instead of the form), as tested with chrome-webdev-tools.

    The "Insert"-Tab does not show, either. (I am however able to directly insert values on the sql-tab and browsing the table works, too.)

    EDIT:
    I just installed phpmyadmin on a new wheezy-based server, there it works, too. So this is probably related to php-version (5.4 in wheezy, 5.3 in squeeze, 5.2 in lenny)

     
    Last edit: Tim Riemenschneider 2013-06-03
  • Isaac Bennetch
    Isaac Bennetch
    2013-06-12

    So to make sure I follow correctly, it seems the 5.2 and 5.4 versions of PHP function correctly and 5.3 is broken. Is that correct?

     
  • Marc Delisle
    Marc Delisle
    2013-11-16

    • summary: Enum with umlauts break editing --> (ok 4.0.5) Enum with umlauts break editing
    • status: open --> fixed
    • assigned_to: Marc Delisle
    • Priority: 5 --> 1
     
  • Marc Delisle
    Marc Delisle
    2013-11-16

    I can reproduce this bug under PHP 5.2.17. In phpMyAdmin 4.0.4 it was still there, but from phpMyAdmin 4.0.5 to 4.0.9 it's fixed.