Permissions error when trying to edit venues & organizers

Home Forums Calendar Products Community Events Permissions error when trying to edit venues & organizers

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1039909
    Kevin
    Participant

    Your recent updates to the Events Calendar have introduced an issue where we cannot edit organizers and venues withing wp-admin.

    According to the readme of the Community Events plugin, there were “tweaks” to permissions on these two post types, but this was introduced in 4.0.

    Specifically, we have administrator privileges, and in a couple of cases multisite super user privileges as well. When we try to Edit Venues or Edit Organizers, the following message is displayed:

    “You are not allowed to edit posts in this post type.”

    Help. This is affecting our workflow and ability to publish events.

    #1040862
    George
    Participant

    Hey @Kevin,

    I’m really sorry to hear about this – we’ve unfortunately seen some other reports of similar behavior, please see this wordpress.org support thread for an example: https://wordpress.org/support/topic/plugin-broke-after-latest-update?replies=6#post-7778292

    At this time, this appears to be the result of various plugin conflicts. Some permissions-related things have indeed changed with the 4.0 releases, like you mentioned, but I cannot recreate any issues with editing Organizers and Venues.


    1. Share System Information

    To get started with investigating this issue, can you first share your “System Information” with us here? Here’s how → https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    2. Test for Conflicts

    I would next recommend doing all of the steps listed here one at a time → https://theeventscalendar.com/knowledgebase/testing-for-conflicts/

    After EACH STEP in that process, try to edit organizers/venues and see if your permissions issues are the same or different.

    This process may sound tedious, but it’s actually a pretty quick process to go through – and it will definitively reveal whether there is a plugin conflict, or a bug.

    Thank you in advance for this information!

    Sincerely,
    George

    #1041770
    Kevin
    Participant

    This is not a plugin conflict. Our site uses the tribe_events_register_venue_type_args filter to exclude Venues from WordPress search. In our functions.php, we have the following:

    function exclude_venue_orgs( $args ) {
        $args['exclude_from_search'] = true;
    }
    add_filter( 'tribe_events_register_venue_type_args', 'exclude_venue_orgs', 10, 1 );

    This used to work just fine. I believe that Pro re-registers venues to allow custom post type search, which we need to prevent. We don’t want venues appearing in WP search results, and we cannot use a pre_get_posts modification, since we use a third-party search solution that relies on the value of exclude_from_search

    Somehow, when this filter is active, the registration of venues is not working correctly. I haven’t been able to figure out why. The best way to see this is to print_r the results of get_post_types at various points in the code. You’ll see that initially the post type object looks correct, but is altered later on with a variety of incorrect parameters for Posts, rather than venues.

    What is the proper way to use tribe_events_register_venue_type_args and tribe_events_register_organizer_type_args filters with the new 4.0 code?

    • This reply was modified 8 years, 4 months ago by Kevin.
    #1041789
    George
    Participant

    Hey @Kevin,

    These filters work exactly the same now as they have in previous releases:

    tribe_events_register_venue_type_args

    tribe_events_register_organizer_type_args

    Just to be 100% clear, do you mean that if you do nothing but disable your customization that adds the exclude_from_search argument, your issues here are resolved?

    #1041956
    Kevin
    Participant

    This is easy to replicate. I just did so on a clean install using an unmodified version of Twenty Twelve as the theme with no plugins.

    Add the following in to functions.php:

    function exclude_venue_orgs( $args ) {
        $args['exclude_from_search'] = true;
    }
    add_filter( 'tribe_events_register_venue_type_args', 'exclude_venue_orgs', 10, 1 );

    Now try to edit venues. You cannot, even with administrator privileges. I realize that the default is to exclude from search, but this gets changed by Pro, which is why we are doing this customization.

    #1042438
    George
    Participant

    I noticed in your code snippet that you are not returning the arguments. In other words, you have just this:

    $args['exclude_from_search'] = true;

    When you should really have this:


    $args['exclude_from_search'] = true;
    return $args;

    How do things behave if you adjust this code?

    — George

    #1076257
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Permissions error when trying to edit venues & organizers’ is closed to new replies.