WordPress.org

Ready to get started?Download WordPress

Forums

Role Scoper
[resolved] Compatibility with long custom post types (3 posts)

  1. Ville Mattila
    Member
    Posted 1 year ago #

    Hi,

    In case you try to use Role Scoper with relatively long custom post types (or taxonomies), you may easily hit the maximum column size in RS database tables.

    Currently (in RS 1.3.56) the maximum column size for the column wp_user2role2object_rs.role_name is 32 characters. RS constructs its post type or taxonomy specific role names by adding a prefix (like _manager or _editor) to the post/taxonomy type identifier.

    For example, I had a custom taxonomy with an id "events_pdcategories_course". Because RS's "Course Category Manager" was given a name "events_pdcategories_course_manager", the role name does not fit into database anymore and gets truncated.

    RS does not give any warning but silently truncates the value in the database, making erroneous behaviour.

    A symptom for this kind of situation is that RS drops the selections for these "long taxonomy" roles.

    The workaround is to alter the RS database tables with following SQL command:
    ALTER TABLE wp_user2role2object_rs MODIFY role_name VARCHAR(64) NOT NULL;

    Note that you need to repeat this on each blog on your network.

    Best regards,
    Ville

    http://wordpress.org/extend/plugins/role-scoper/

  2. kevinB
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for letting me know. The correction will be included in RS 1.3.57.

  3. kevinB
    Member
    Plugin Author

    Posted 1 year ago #

    For anyone doing a manual workaround, you also need:

    ALTER TABLE wp_role_scope_rs MODIFY role_name VARCHAR(64) NOT NULL;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic