logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$90
BuddyPress activity stream not showing bp_activity.action

More title: it's showing only the bp_activity.content.

I have a site running WordPress 3.2.1 and BuddyPress 1.5.1. Custom theme I inherited. In BP 1.2.8, the activity stream was showing the action properly. I have customized the action to be in a different format. Right now, the only thing that appears on the {username}/activity tab is the avatar, and the space where the action should be shown, was showing. It is looping through all the activity, and outputting a div for each, but there is no "action" shown.

When I activate the BP Default theme, the activity action is shown properly.

I'd like to work with someone to troubleshoot and resolve this issue. Thank you.

Chris Hajer | 11/28/11 at 8:55am Edit
Tutorial: How to assign prize money

Previous versions of this question: 11/28/11 at 8:20pm

(1) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    11/28/11
    9:00am
    Francisco Javier Carazo Gil says:

    Hi Chris,

    I have been working with BuddyPress for a year.

    Can you paste how you have changed the action?

    • 11/28/11 9:04am

      Chris Hajer says:

      // bug 794, record custom post type activity
      function tc_cpt_activity($post_id, $post, $user_id = false) {
      global $bp, $wpdb;

      $cpts = array('news', 'volunteering', 'freecycle', 'jobs', 'buy-sell', 'recommendations', 'housing');
      $post_id = (int)$post_id;
      $blog_id = (int)$wpdb->blogid;

      if (!$user_id)
      $user_id = (int)$post->post_author;

      /* This is to stop infinite loops with Donncha's sitewide tags plugin
      / commented out since we're not using that plugin
      if ((int)$bp->site_options['tags_blog_id'] == (int)$blog_id)
      return false; */

      /* Don't record this if it's not is our array of custom post types */
      if (!in_array($post->post_type, $cpts))
      return false;

      if ('publish' == $post->post_status && '' == $post->post_password) {
      /* Record this in activity streams */
      $post_permalink = get_permalink($post_id);
      $cpt_url = tc_cpt_url($post->post_type);
      $obj = get_post_type_object($post->post_type);
      $activity_action = sprintf(__('%s posted %s under %s', 'buddypress'), bp_core_get_userlink((int)$post->post_author), '<a title="' . $post->post_title . '" href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a title="View all ' . $obj->labels->name . '" href="' . $cpt_url . '">' . $obj->labels->name . '</a>');
      $activity_content = $post->post_content;
      bp_blogs_record_activity(array(
      'user_id' => (int)$post->post_author,
      'action' => apply_filters('bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink),
      'content' => apply_filters('bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink),
      'primary_link' => apply_filters('bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id),
      'type' => 'new_blog_post',
      'item_id' => $blog_id,
      'secondary_item_id' => $post_id,
      'recorded_time' => $post->post_date_gmt
      ));
      } else
      bp_blogs_remove_post($post_id, $blog_id);

      bp_blogs_update_blogmeta($blog_id, 'last_activity', bp_core_current_time());

      do_action('bp_blogs_new_blog_post', $post_id, $post, $user_id);
      }
      add_action('save_post', 'tc_cpt_activity', 10, 2);


      That is the function that saves the action. The database stores the action properly. It's just not being output by the theme.

      Thanks for your reply.

    • 11/28/11 9:13am

      Chris Hajer says:

      Also, to be clear, I only change the format of the action for custom post type activity. I do not change the action for these types of activity:

      joined_group
      created_group
      new_avatar
      activity_update
      activity_comment
      new_calendar_event (I'm using the BP Group Calendar plugin)

      I don't see the bp_activity.action for any type of activity, not just CPT. Thank you.

    • 11/28/11 10:28am

      Francisco Javier Carazo Gil says:

      Chris,

      I have been seeing your code and I see everything OK.

      Have you set WP_DEBUG true? You can do the next 5 ways to debug WordPress:
      1. define( 'WP_DEBUG', true ); // in wp-config.php
      2. define( 'SCRIPT_DEBUG', true ); // in wp-config.php
      3. define( 'SAVEQUERIES', true ); // in wp-config.php to save what queries are exectuted
      4. add_action( 'all', create_function( '', 'var_dump( current_filter() );' ) ); // in functions.php to see how many hooks get executed on every page load
      5. http://wordpress.org/extend/plugins/core-control/ // this plugin to control core WP

    • 11/28/11 4:05pm

      Chris Hajer says:

      I have added the three defines to wp-config.php and the one function to my theme's functions.php. I did not install the core control plugin yet.

      What output can I share with you to help debug this?

      Here is a page on the website so you can see what's going on right now:
      http://townconnection.com/rockford-illinois/neighbors/chrishajer/activity/

      Thank you.

    • 11/29/11 3:23am

      Francisco Javier Carazo Gil says:

      Chris,

      If no errors appear, try to put "show_errors = true" in php.ini and then reload the service of the http daemon.

    • 11/29/11 3:29am

      Francisco Javier Carazo Gil says:

      Chris,

      Sorry, the correct parameter is "display_errors = true" and you also should set "error_reporting = E_ALL & ~E_DEPRECATED".

    • 11/29/11 3:29am

      Francisco Javier Carazo Gil says:

      Chris,

      Sorry, the correct parameter is "display_errors = true" and you also should set "error_reporting = E_ALL & ~E_DEPRECATED".

    • 11/29/11 3:45am

      Chris Hajer says:

      There are lots of warnings and notices. I am on a shared host, so I can't restart HTTPD. But I think the output is sufficient already. Warnings and noticed are displayed. Do we need more?

    • 11/29/11 5:10am

      Francisco Javier Carazo Gil says:

      Chris,

      Send me via PM all notice and warnings please.

    • 11/29/11 8:35am

      Chris Hajer says:

      PM sent. Please let me know if you need more information.

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.