WordPress.org

Support

Support » Plugins and Hacks » NextGEN Custom Fields » [Resolved] [Plugin: NextGEN Custom Fields] Conversion to UTF-8 also updates field_value to VARCHAR(255)

[Resolved] [Plugin: NextGEN Custom Fields] Conversion to UTF-8 also updates field_value to VARCHAR(255)

  • First off, great plugin! It’s super useful for anyone who wants to extend the options for NextGen gallery.

    Minor issue with the new version though. During the update process, the field_value column of TEXT field is converted to a VARCHAR 255 and loses the field data if it is longer than 255.

    This line in particular is the issue, line 103:
    $wpdb->query('ALTER TABLE '.$table_name.' MODIFY field_value varchar(255) CHARSET utf8;');

    http://wordpress.org/extend/plugins/nextgen-gallery-custom-fields/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author shauno

    @shauno

    Good spot, and thanks for the feedback.
    I have committed 1.2.1 changing the field value back to TEXT.

    I have left the labels as VARCHARs, as they really shouldn’t be that long anyway 🙂

    yashiharu

    @yashiharu

    I just make it work with changing from var255 to 1024 by phpMyAdmin …

    I would like to know if the data will lost if i updated to ver1.2.1?

    Plugin Author shauno

    @shauno

    No yashiharu, no data should be lost. It will just allow for MUCH more data to be stored now.

    Sorry for the oversight originally.

    Thanks shauno! Looks great now. 🙂

    I need a drop-down that lists all US states and Canadian provinces, but this same issue prevents me from doing so.

    I have manually updated the DB, but wanted to point this out.

    Plugin Author shauno

    @shauno

    Change line 76 of ngg_custom_fields.php from this:
    $wpdb->query('ALTER TABLE '.$table_name.' MODIFY drop_options varchar(255) CHARSET utf8;');
    to this:
    $wpdb->query('ALTER TABLE '.$table_name.' MODIFY drop_options TEXT CHARSET utf8;');

    I have made the change in the trunk code, but don’t really want to release another update for such a change. The next release will have it in, so you can update at that time and nothing will break for you 🙂

    [ Signature moderated. ]

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: NextGEN Custom Fields] Conversion to UTF-8 also updates field_value to VARCHAR(255)’ is closed to new replies.
Skip to toolbar