WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Serious Buddypress user deletion bug (15 posts)

  1. lackingpenguin
    Member
    Posted 2 years ago #

    When using the newest version of Events Manager (5.0rc1) with the newest version of Buddypress (1.5.2), you may notice that if you delete a user who has posted no events, ALL upcoming events are deleted too!

    This is because the delete() method of the EM_Events (classes/em-events.php) class will delete all upcoming events if passed an empty array as an argument. This is obviously not the desired behavior.

    To fix, simply replace line 141 of classes/em-events.php:

    if( @get_class(current($array)) != 'EM_Event' ){

    with:

    if( !empty($array) && @get_class(current($array)) != 'EM_Event' ){

    All the best,
    Ben

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    Got your mail, thanks for pointing this out!

  3. avibinamo
    Member
    Posted 2 years ago #

    I see this line is implemented but I still get the same problem when deleting a user. Any suggestions?

  4. avibinamo
    Member
    Posted 2 years ago #

    I've solved it:

    Changed line 144 from:
    elseif{

    To:

    elseif(!empty($array)){

    Thanks!

  5. agelonwl
    Member
    Posted 2 years ago #

    thanks for sharing.

  6. per4mance
    Member
    Posted 2 years ago #

    Does this bug still exists with Events Manager v5.1.6?

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I'm pretty sure this was fixed.

    @avibinamo, what file is that?

  8. per4mance
    Member
    Posted 2 years ago #

    @Marcus
    Yes it is fixed, I tested it.

  9. avibinamo
    Member
    Posted 2 years ago #

    @Marcus
    The row has changed to the solution suggested above but I still get the same issue when deleting a user that has no posts.

    @per4mance Did you try it on a user without any post/events and etc..?

  10. per4mance
    Member
    Posted 2 years ago #

    @Marcus
    I created a user without any post. 5 minutes later I deleted the account, that means, me as a new user deleted the account, not as an admin.

  11. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    will test it out again, but still pretty sure it was fixed

    @avibinamo did you try this with other plugins except EM and BP disabled?

  12. agelonwl
    Member
    Posted 2 years ago #

    @avibinamo
    I tested it and seems to work fine; also, you might want to try the latest dev version?

    @per4mance
    you can disable user deletion at Buddypress settings > settings > Disable user account deletion?Yes

  13. per4mance
    Member
    Posted 2 years ago #

    @agelonwl
    I know that I can disable user account deletion by users but this is what I find very helpful if a user can decide to delete his account. This creates trust. No other networks do that.

  14. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    @per4mance, I'm confused, is this working as expected now, or not?

    @avibinamo from the looks of it, the problem is limited to you specifically, try my previous suggestion

  15. per4mance
    Member
    Posted 2 years ago #

    @Marcus
    For me it's working fine. Today I've got the hint by WordPress a new version of Event Manager has released but I didn't tested. I do this later.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic