Skip to:
Content

BuddyPress.org

Changeset 9039


Ignore:
Timestamp:
09/23/2014 09:09:29 PM (10 years ago)
Author:
r-a-y
Message:

Blogs: Check if activity component is active before using activity meta functions.

Previously, r8944 used some functions to mirror the blog post title to the
activity meta table. However, a check was not made to determine if the
activity component was active. This caused a fatal error for sites that
have the activity component disabled.

Fixes #5897 (trunk).

Anti-props r-a-y.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r8965 r9039  
    535535
    536536            // save post title in activity meta
    537             bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
    538             bp_activity_update_meta( $activity_id, 'post_url',   $post_permalink );
     537            if ( bp_is_active( 'activity' ) ) {
     538                bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
     539                bp_activity_update_meta( $activity_id, 'post_url',   $post_permalink );
     540            }
    539541        }
    540542
Note: See TracChangeset for help on using the changeset viewer.