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

  1. Ville Mattila
    Posted 3 years ago #


    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,


  2. Kevin Behrens
    Plugin Author

    Posted 3 years ago #

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

  3. Kevin Behrens
    Plugin Author

    Posted 3 years 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

  • Role Scoper
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic