WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] BuddyPress Activity Stream showing Non-registered User is attending event (6 posts)

  1. ngkokkee
    Member
    Posted 1 year ago #

    Hi,

    I am using BuddyPress 1.5.5 with Events Manager 5.2.9.

    The events manager bookings management correctly shows the user who booked the event. However on the BuddyPress activity stream, it shows Non-registered User is attending event, even for my own bookings.

    The only customization I did for my site is to use wp_set_current_user to login the user instead of using the wordpress default login page because of single sign-on.

    This is the code section dealing with the login.

    wp_set_current_user($user_id, $user_login);
    wp_set_auth_cookie($user_id);
    do_action('wp_login', $user_login);
    //bp_core_redirect is required to fix the login problem where user name is not setup correctly in the first page.
    bp_core_redirect(get_option('siteurl').$_SERVER['REQUEST_URI']);

    Regards
    Kok Kee

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

  2. agelonwl
    Member
    Posted 1 year ago #

    I tried this one and seems to be working fine; Is it working without your customization?

  3. ngkokkee
    Member
    Posted 1 year ago #

    One line code change fixed the problem.

    In the file events-manager\buddypress\bp-em-activity.php

    function bp_em_record_activity_booking_save( $result, $EM_Booking )
    
    	$user = $EM_Booking->person;

    replace with

    $user = $EM_Booking->get_person();

    Not sure why $EM_Booking->person is not initialized but the class itself seems to be using $EM_Booking->person_id which is valid. The $EM_Booking->get_person() checks whether $EM_Booking->person is initialized and initialize it with $EM_Booking->person_id if not.

  4. ngkokkee
    Member
    Posted 1 year ago #

    Any developer prowling around can confirm whether this can be patched in the next release?

    I didn't test much of the buddypress features but you might need to take a look at other code access object members directly whether they should also be using the get_ functions instead.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    yup, confirmed will be added. well spotted.

  6. ngkokkee
    Member
    Posted 1 year ago #

    Thanks, I will mark the topic resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic