WordPress.org

Ready to get started?Download WordPress

Forums

Role Scoper
Role Scoper + Revisionary breaks TinyMCE (3 posts)

  1. dorsetjon
    Member
    Posted 1 year ago #

    We are using Role Scoper and Revisionary. If the following setup is performed then TinyMCE is no longer loaded for users with the Page Revisor role on the page being edited, thus editing is broken:

    1. Role Scoper is used to assign some users as Page Revisors and other users Page Editors on a given page, and
    2. Revisionary is configured to send emails when a revision is submitted ("Email designated Publishers when a Pending Revision is submitted" is Default or Always)

    This issue only occurs when Revisionary and Role Scoper are used together. We are using Role Scoper 1.3.57 and Revisionary 1.1.9 and have tested this with WP 3.4.1 and 3.4.2.

    Checking the HTML source for the page where editing is broken shows that all HTML and Javascript is after a certain point is missing, and this includes all the TinyMCE Javascript.

    It looks like an exception is occurring in Revisionary or Role Scoper that is halting the creation of the page at a given point. I have put WordPress in debug mode and found that the following errors occur when with this issue happens:

    WordPress database error: [Incorrect usage of ALL and DISTINCT]
    SELECT DISTINCT all FROM wp_users INNER JOIN wp_user2role2object_rs AS uro ON uro.user_id = wp_users.ID WHERE 1=1 AND uro.user_id > 0 AND ( ( ( ( ( ( ( uro.scope = 'object' AND uro.assign_for IN ('entity', 'both') AND uro.src_or_tx_name = 'post' AND uro.role_type = 'rs' AND uro.role_name IN ('page_editor','editor','administrator') AND uro.obj_or_term_id = '434' ) ) OR ( ( uro.scope = 'blog' AND uro.role_type = 'rs' AND uro.role_name IN ('page_editor') ) OR ( uro.scope = 'blog' AND uro.role_type = 'wp' AND uro.role_name IN ('editor','administrator') ) ) ) ) OR ( ( ( ( uro.scope = 'object' AND uro.assign_for IN ('entity', 'both') AND uro.src_or_tx_name = 'post' AND uro.role_type = 'rs' AND uro.role_name IN ('page_author') AND uro.obj_or_term_id = '434' ) ) OR ( ( uro.scope = 'blog' AND uro.role_type = 'rs' AND uro.role_name IN ('page_author') ) OR ( uro.scope = 'blog' AND uro.role_type = 'wp' AND uro.role_name IN ('administrator') ) ) AND uro.user_id = '37' ) ) ) ) )

    Warning: Illegal offset type in isset or empty in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 422

    Warning: hash_hmac() expects parameter 2 to be string, object given in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 478

    Warning: Illegal offset type in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 447

    Warning: Illegal offset type in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 624

    Warning: Illegal offset type in isset or empty in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 626

    Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 688

    Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/vhosts/swallowboatsassociation.com/httpdocs/dev/wordpress/wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 688

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

  2. dorsetjon
    Member
    Posted 1 year ago #

    OK, making progress. Broadly speaking, there are 2 issues here. First, the SQL is incorrect because it includes "ALL" and "DISTINCT" (it should contain one or the other but not both) and there is no column list. That needs fixing but isn't the cause of the TinyMCE issue.

    The second issue is that in the following file there are multiple occasions when objects are treated as strings but this is not supported from PHP version 5.2:

    role-scoper/hardway/cache-persistent.php

    That needs changing. The particular bug that is causing the TinyMCE issue is on line 688:

    $ids = array_unique($ids);

    Fortunately that one is an easy fix by adding the SORT_REGULAR parameter:

    $ids = array_unique($ids, SORT_REGULAR);

    Making that change means TinyMCE is now available again. An alternative workaround for those that don't want to edit code is to turn off Role Scoper caching by unticking the checkbox in:

    Roles->Options->Features->Internal Cache

    Hopefully this will be fixed in the next version of Role Scoper because it breaks functionality for anyone using PHP 5.2 or higher.

  3. dorsetjon
    Member
    Posted 1 year ago #

    This is still broken in version 1.3.59. Is there any chance of a fix?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic