Skip to:
Content

BuddyPress.org

Changeset 5091


Ignore:
Timestamp:
09/01/2011 02:42:48 PM (13 years ago)
Author:
boonebgorges
Message:

Make sure that null values are provided for topic details when the last poster on a topic has since been deleted. Ensure that 'Deleted User' text is output when necessary on forum directories. Fixes #3541.

Location:
trunk/bp-forums
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-functions.php

    r5047 r5091  
    384384    }
    385385
     386    // Loop through to make sure that each topic has the proper values set. This covers the
     387    // case of deleted users
     388    foreach ( (array)$topics as $key => $topic ) {
     389        if ( !isset( $topic->topic_last_poster_email ) )
     390            $topics[$key]->topic_last_poster_email = '';
     391
     392        if ( !isset( $topic->topic_last_poster_nicename ) )
     393            $topics[$key]->topic_last_poster_nicename = '';
     394
     395        if ( !isset( $topic->topic_last_poster_login ) )
     396            $topics[$key]->topic_last_poster_login = '';
     397
     398        if ( !isset( $topic->topic_last_poster_displayname ) )
     399            $topics[$key]->topic_last_poster_displayname = '';
     400    }
     401
    386402    return $topics;
    387403}
  • trunk/bp-forums/bp-forums-template.php

    r5089 r5091  
    555555        global $forum_template;
    556556
    557         if ( !$domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login ) )
     557        $domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login ) ;
     558
     559        // In the case where no user is found, bp_core_get_user_domain() may return the URL
     560        // of the Members directory
     561        if ( !$domain || $domain == bp_core_get_root_domain() . '/' . bp_get_members_root_slug() . '/' )
    558562            return __( 'Deleted User', 'buddypress' );
    559563
Note: See TracChangeset for help on using the changeset viewer.