WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Custom Fields
[resolved] Conversion to UTF-8 also updates field_value to VARCHAR(255) (7 posts)

  1. Katherine Semel-Munson
    Member
    Posted 2 years ago #

    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/

  2. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    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 :)

  3. yashiharu
    Member
    Posted 2 years ago #

    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?

  4. shauno
    Member
    Plugin Author

    Posted 2 years ago #

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

    Sorry for the oversight originally.

  5. Katherine Semel-Munson
    Member
    Posted 2 years ago #

    Thanks shauno! Looks great now. :)

  6. theoutdoors
    Member
    Posted 2 years ago #

    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.

  7. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    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. ]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic