Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter julpero

    (@julpero)

    Now it’s ok, thank you very much!

    Thread Starter julpero

    (@julpero)

    I add collation to the function getExcludedPosts:

    $sObjectQuery = “SELECT DISTINCT gp.object_id AS id, gp.object_type collate utf8mb4_bin AS type
    $sPostQuery = “SELECT DISTINCT p.ID AS id, post_type collate utf8mb4_bin AS type

    But I’m not really sure is that correct to use hard coded collations…

    Thread Starter julpero

    (@julpero)

    Good news, after modifying your query to use same collation in both union queries it worked.

    Thread Starter julpero

    (@julpero)

    No it didn’t work.

    I tried to debug that version with query monitor and if I use regular user (editor) query monitor shows an error.

    Query:
    SELECT DISTINCT p.ID AS id, post_type AS type
    FROM wp_posts AS p
    INNER JOIN wp_term_relationships AS tr
    ON p.ID = tr.object_id
    INNER JOIN wp_term_taxonomy AS tt
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE p.post_type != ‘revision’
    AND tt.taxonomy = ‘category’
    AND tt.term_id IN (SELECT gc.object_id
    FROM wp_uam_accessgroups iag
    INNER JOIN wp_uam_accessgroup_to_object AS gc
    ON iag.id = gc.group_id
    WHERE gc.object_type = ‘term’
    AND iag.write_access != ‘all’)
    AND p.ID NOT IN (16968, 7)
    UNION SELECT DISTINCT gp.object_id AS id, gp.object_type AS type
    FROM wp_uam_accessgroups AS ag
    INNER JOIN wp_uam_accessgroup_to_object AS gp
    ON ag.id = gp.group_id
    LEFT JOIN wp_term_relationships AS tr
    ON gp.object_id = tr.object_id
    LEFT JOIN wp_term_taxonomy tt
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE gp.object_type IN (‘post’,’page’,’attachment’)
    AND ag.write_access != ‘all’AND gp.object_id NOT IN (16968, 7)

    Call Stack:
    UamAccessHandler->getExcludedPosts()
    wp-content/plugins/user-access-manager/class/UamAccessHandler.php:664
    UserAccessManager->showPostCount()
    wp-content/plugins/user-access-manager/class/UserAccessManager.php:1610
    apply_filters(‘wp_count_posts’)
    wp-includes/plugin.php:203
    wp_count_posts()
    wp-includes/post.php:2234
    get_available_post_statuses()
    wp-admin/includes/post.php:984
    wp_edit_posts_query()
    wp-admin/includes/post.php:1009
    WP_Posts_List_Table->prepare_items()
    wp-admin/includes/class-wp-posts-list-table.php:142

    Plugin: user-access-manager

    Error: Illegal mix of collations for operation ‘UNION’

    Those linenumbers may not be accurate because I have wrote some error_log -degug rows into them.

    Thread Starter julpero

    (@julpero)

    Good news!

    I’ve tried to debug it so many times by myself that I really want to know where the problem was…

    Thread Starter julpero

    (@julpero)

    It didn’t fix my issue.

    My groups are usually:
    Read access: all
    Write access: only group users

    And as I said in Posts -admin page shows to user only those pages on which user has write access but in Pages -admin page the user sees always all pages.

    Hide complete posts / Hide complete pages doesn’t have any effect to those admin pages.

    Thread Starter julpero

    (@julpero)

    No I don’t think so…

    Thread Starter julpero

    (@julpero)

    Well it didn’t fix the issue either. Not the newest version 1.2.7.6 nor disabling all other plugins.

    I just noticed that posts admin page works. It show’s only those posts user has rights. The pages admin page shows all pages to everyone.

    And one thing I don’t have said earlier, I have multisite installation.

    How I can contact you so I can give you access to my test site and send database?

    Thread Starter julpero

    (@julpero)

    Did your response end correctly?

    I have a hosted production site and then I have a test site on my computer. I’ll give you access to that test site and database dumb.

    Should I upgrade to 1.2.6.6?

    Thread Starter julpero

    (@julpero)

    Hi, I disabled all other plugins when I tested 1.2.7.4. I will try that again when it’s morning here in Finland…

    What do you exactly need if I create access to you? Or how I could send my db?

    Thread Starter julpero

    (@julpero)

    Hi and thanks for the new version.

    Unfortunately this didn’t fix my problem. All users still sees all pages…

    Thread Starter julpero

    (@julpero)

    Yes – sorry if I was a bit inaccurate…

    I have site that has about 150 pages and 10 user groups 15 pages each. Now each user see 150 pages in admin pages which is little frustrating.

    • This reply was modified 9 years, 5 months ago by julpero.
    Thread Starter julpero

    (@julpero)

    Well yes. All groups and pages seems to be ok.

    That All Pages admin screen shows all pages in the list. But if user that doesn’t have rights to edit some page still tries to edit it, page goes to error screen “You have no rights to access this content.”

    If restricted user does “quick edit” to the page he has rights then in “Parent” drop down there is no pages on which user does not have rights.

Viewing 13 replies - 1 through 13 (of 13 total)