Support » Plugin: BuddyPress for LearnDash » Lesson comments do not show within associated course group?

  • Hello!

    I only want to use this plugin so that comments created within lessons are posted/shared within buddypress groups that are tied with the relevant course.

    After installing the plugin and setting it up, I was impressed as it seemed to do the trick after posting a test comment in the first lesson of a course. However, I shortly discovered that for some reason this only works with ONE single lesson? For example..

    I post a comment in Lesson1, it shows in the group activity feed. I post a comment in Lesson2 (or any other), the comment does not display in the group activity feed.

    How is it possible that the plugin would only work with one lesson and not all lessons?

    I have tried deactivating all plugins and changing themes to see if there are any conflicts, but I have found none.

    Previously, I was using this code:

    /* Post Comments in Buddypress Activity */
    function bca_record_activity($comment_id, $approval) {
        if($approval == 1) {
            $comment = get_comment($comment_id);
            $userlink = bp_core_get_userlink($comment->user_id);
            $postlink = '<a href="' . get_permalink($comment->comment_post_ID) . '">' 
                            . get_the_title($comment->comment_post_ID) . '</a>';
     
            bp_activity_add(array(
                'action'            => sprintf( __( '%1$s commented on the lesson: %2$s', 'buddypress' ), 
                                                    $userlink, $postlink),
                'content'           => $comment->comment_content,
                'component'         => 'bp_plugin',
                'user_id'           => $comment->user_id,
                'type'              => 'new_blog_comment',
            ));
         
        }
    }
    //comment_post is triggered "just after a comment is saved in the database".
    add_action('comment_post', 'bca_record_activity', 10, 2);
    // We want activity entries of blog comments to be shown as "mini"-entries
    function bca_minify_activity($array) {
        $array[] = 'new_blog_comment';
        return $array;
    }
    add_filter('bp_activity_mini_activity_types', 'bca_minify_activity');
    // Disables comments on this type of activity entry
    function bca_remove_commenting($can_comment) {
        if($can_comment == true) {
    		$can_comment = ! ('new_blog_comment' == bp_get_activity_action_name());
        }
        return $can_comment;
    }
    add_filter('bp_activity_can_comment', 'bca_remove_commenting');

    Is there any way I might be able to simply adapt that code so that rather than comments appearing in activity feeds, they rather appear in the corresponding course group associated with the lesson?

    Thanks!!

    • This topic was modified 9 months, 2 weeks ago by King Ding.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter King Ding

    (@dazzerr)

    I would like to add that when other course activity settings are checked such as “User completes a lesson”, this information is sent to the group activity feed… It’s just the comments that don’t seem to show up for some reason?

    Also when posting a comment within a topic, the group feed shows a “USER posted an update in the group XXXXX”.

    Lastly I noticed that when writing a genuine update in the main group activity, after clicking submit- nothing happens. I don’t understand how this could be happening since all plugins are disabled (except necessary), and I’ve tried with a mixture of themes.

    It’s as if the features of this plugin are all mixed up?

    Thread Starter King Ding

    (@dazzerr)

    After some testing, I notice that in my database under the ‘bp_activity’ table, the lesson_comment is recorded when I comment in Lesson1. However when I comment in any other lesson besides this one, these comments are not recorded into the database under the ‘bp_activity’ table (only the ‘comments’ table).

    By adding add_action('comment_post', 'bp_learndash_record_activity', 10, 2); to: bp-learndash-functions.php I can now see blank entries recorded in the database and in the group feed. No information is recorded, but at least the act of commenting is being recorded.

    I’ve experimented by changing some information between lines 370-409 in bp-learndash-functions.php of the plugin, but had no success. Perhaps I’m looking in the wrong place? Any suggestions on why information might not be getting logged in the database would be very much appreciated!

    Thanks!

    • This reply was modified 9 months, 2 weeks ago by King Ding.

    I have the same weird problem. Did you manage to solve it?

    Thread Starter King Ding

    (@dazzerr)

    I actually created my own plugin that sends lesson comments to the group, and replies to those group comments back to the lesson comment, giving a two way sync between 🙂 I may release it, but you’re the first person I’ve heard of besides myself who has requested this. It would be great if BuddyBoss included this in their own plugins.

    It seems that buddyboss is not that interested in providing support for this. I be happy to test out your plugin, if you want to share it. Mail to info@thobey.com

    smalto

    (@smalto)

    Hi,
    I have the same problem, I had believed it was due to a plugin conflict but after reading your review it seems to me to be a general case. Some people don’t use it that’s why they don’t talk about it, I want comments on lessons and chapters to create activities in groups. Can you send me your shortcode before learndash-buddypress patch by buddyboss. mail: mnpetitvie@gmail.com.
    Thank you

    i need this so much!

    it make month that i want to implement this!

    can you please send me your plugin?: adam@solutionera.com

    thank you!

    Hi there, I’d also like the same thing! Would love to try your plugin if you’re open to it!

    jason@coachesrising.com

    no answer for me yet! email me if you have any news about this!

    adam@solutionera.com

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