Support » Plugin: Events Manager » Events Manager Groups plugin

  • Resolved che-mat



    I’ve been using this plugin together with Woocommerce, Groups and Groups for Woocommerce.

    I’m trying to set 2 groups capability to one events post but everytime I try to save the post, the selected capabilities does not seem to be saved, even if you have saved 1 group capability before, it seems the save only removes any groups capabilities attached to that post. It won’t happen if I set only 1 capability to the post, but when selecting more then 1, then the problem occurred.

    I initially post a message in Groups’ support forum and got their reply saying that it has something to do with capabilities.

    Excerpt of what Kento from itthinx found out are as follows:

    When you try to restrict access by checking the boxes, Groups verifies (*) that you actually are allowed to do that using the current_user_can(…) function provided by WordPress. The execution flow of that function results in the map_meta_cap filter being triggered via WP_User‘s has_cap< ( $cap ) which invokes the map_meta_cap(…) function defined in capabilities.php.
    (*) The call through Groups_Access_Meta_Boxes::save_post(…) results in two parameters being passed to map_meta_cap(…), ‘edit_event’ and the current user’s ID. The third parameters that em_map_meta_cap(…) expects to be there isn’t, because it’s not about the post but just about the user.
    Events Manager hooks itself into the map_meta_cap filter and erroneously returns an empty array of capabilities for a user who tries to edit an event when the call happens in Groups_Access_Meta_Boxes::save_post(…).
    This notice is thrown out:
    Notice: Trying to get property of non-object in /var/www/wptest/wp-content/plugins/events-manager/em-posts.php on line 318
    because $post_type on that call is missing the property capem_map_meta_cap(…), this is going to fail.

    Full message:

    Any help would be appreciated.

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Marcus


    NetWebLogic Support

    I replied on there, but for posterity:

    Hey Kento, Marcus here, EM dev.

    I’ll need to test out your plugin to verify this for sure (some time will be needed for this), but looking at a simple example –

    you’ll see that the $post_type, which is what I’m retreiving from $args, should be available to me.

    are you sure its not something on your side? if you have any ideas in the meantime that’d be great.

    Marcus in case you haven’t seen it, I’m proposing a patch that fixes the issue:

    Plugin Author Marcus


    NetWebLogic Support

    Thanks, I’ve noted this down and will test/implement asap.

    It’ll have to be end of next week or first days of Jan due to the holidays (on that note, happy holidays!)

    That’s great Marcus, have a joyful time & Happy Holidays *<:-)

    Plugin Author Marcus


    NetWebLogic Support

    cheers, hope you had a good xmas time and have a happy new year :=)

    will let you know when this is sorted out.

    Plugin Author Marcus


    NetWebLogic Support

    just to update you all here, the latest update 5.3.3 has itthinx’s update which should fix the issue

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Events Manager Groups plugin’ is closed to new replies.