Support » Plugin: Events Manager » [CODE FIX] Buddypress Attending Tab: conditional loading

  • Hi @netweblogic,
    I’ll report another bug in the following file:

    events-manager/buddypress/bp-em-core.php#L101

    Bug Description:
    Attending tab must be activated only if the booking reservations are enabled. (currently it is always displayed, even if rsvp is disabled)

    How to fix it:

    if( get_option('dbem_rsvp_enabled') ) { // Additional check condition
    
    	$sub_nav[] = array(
    		'name' => __( 'Events I\'m Attending', 'events-manager'),
    		'slug' => em_bp_get_slug( 'attending' ),
    		'parent_slug' => em_bp_get_slug(),
    		'parent_url' => $em_link,
    		'screen_function' => 'bp_em_attending',
    		'position' => 20,
    		'user_has_access' => bp_is_my_profile() // Only the logged in user can access this on his/her profile
    	);
    
    }
    

    Regards,
    Raruto

Viewing 2 replies - 1 through 2 (of 2 total)
  • For the same reason I report here a similar error in the following template file:

    events-manager/templates/buddypress/profile.php#L31

    Bug Description:
    Attending information must be visible on profile page only if the booking reservations are enabled. (currently they are always displayed, even if rsvp is disabled)

    How to fix it:

    <?php if( get_option('dbem_rsvp_enabled') ) : ?><!-- Additional check condition -->
    	<h4><?php _e("Events I'm Attending", 'events-manager'); ?></h4>
    	<?php
    	$EM_Person = new EM_Person( $bp->displayed_user->id );
    	$EM_Bookings = $EM_Person->get_bookings( false, apply_filters('em_bp_attending_status',1) );
    	if(count($EM_Bookings->bookings) > 0){
    		//Get events here in one query to speed things up
    		$event_ids = array();
    		foreach($EM_Bookings as $EM_Booking){
    			$event_ids[] = $EM_Booking->event_id;
    		}
    		echo EM_Events::output(array('event'=>$event_ids));
    	}else{
    		?>
    		<p><?php _e('Not attending any events yet.','events-manager'); ?></p>
    		<?php
    	}?>
    <?php endif; ?>
    
    Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi, I’ve let the Devs know about this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.