Skip to:
Content
Pages
Categories
Search
Top
Bottom

When replying to a comment I get – Warning: Creating default object from empty value in bp-default_


  • TripWest
    Participant

    @tripwest

    The only time that I’m getting this warning is when replying to a comment. The lines (316-332) of the code for this section are below. Does anybody know how to prevent this warning? I know that I can cover it up, but I’d rather fix the problem than sweep it under the rug. I am using WP 3.4.2 and BP 1.6.1

    ‘$comment_id = bp_activity_new_comment( array(
    ‘activity_id’ => $_POST,
    ‘content’ => $_POST,
    ‘parent_id’ => $_POST,
    ) );

    if ( ! $comment_id )
    exit( ‘-1

    ‘ . __( ‘There was an error posting that reply, please try again.’, ‘buddypress’ ) . ‘

    ‘ );

    // Load the new activity item into the $activities_template global
    bp_has_activities( ‘display_comments=stream&hide_spam=false&include=’ . $comment_id );

    // Swap the current comment with the activity item we just loaded
    $activities_template->activity->id = $activities_template->activities[0]->item_id;
    $activities_template->activity->current_comment = $activities_template->activities[0];

    $template = locate_template( ‘activity/comment.php’, false, false );’

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘When replying to a comment I get – Warning: Creating default object from empty value in bp-default_’ is closed to new replies.
Skip to toolbar