Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#5567 closed defect (bug) (fixed)

Nested activity comments do not show when logged out

Reported by: r-a-y's profile r-a-y Owned by: djpaul's profile djpaul
Milestone: 2.1 Priority: high
Severity: normal Version: 1.5
Component: Appearance - Template Pack Keywords: needs-patch good-first-bug commit
Cc: wolfhoundjesse@…

Description

Reported here:
http://buddypress.org/support/topic/show-activity-comments-to-everybody/

Problem occurs because we have a is_user_logged_in() check before activity comments are rendered.

This change was added in r4691 in bp-default and ported over to bp-legacy.

Any reason why this is done? Since this is quite old and no one has really reported it until now, is it an issue?

Attachments (2)

5567.01.patch (1.0 KB) - added by r-a-y 11 years ago.
5567.02.diff (972 bytes) - added by wolfhoundjesse 10 years ago.

Download all attachments as: .zip

Change History (15)

@r-a-y
11 years ago

#1 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 2.1

Weird. I assume that bp_activity_can_comment() was a poor-man's way of checking whether comments could exist for the given activity item. (The commit message is not very explicit and there is no linked ticket :-/)

IMO, the proper logic is something like: show the activity section if one of the following is true:

  • there are existing comments (which anyone would be able to see, whether logged in or not)
  • the current user is logged in + commenting on this activity item is permitted (in which case we need to show the comment form)

In other words:

if ( bp_activity_get_comment_count() || ( is_user_logged_in() && bp_activity_can_comment() ) )

Does that seem right?

#2 @DJPaul
10 years ago

  • Keywords needs-patch added; 2nd-opinion has-patch removed

I think we should move the is_user_logged_in check inside the bp_activity_can_comment as that seems a logical place. Would be nice if someone catch patch this or Boone's suggestion together for 2.1; I'm not fussed either way.

#3 @DJPaul
10 years ago

  • Keywords good-first-bug added

This ticket was mentioned in IRC in #buddypress-dev by paulgibbs. View the logs.


10 years ago

#5 @DJPaul
10 years ago

  • Priority changed from normal to high

#6 @wolfhoundjesse
10 years ago

  • Cc wolfhoundjesse@… added

Good morning,

I changed the check so that existing comments would be displayed:

  • if they indeed exist
  • if comments are allowed on this particular activity

I left the check for whether or not the activity is_single. If the user is logged in and comments are allowed, display the comment form.

I completed the OpenHatch missions, but I'm very new to SVN. I'll attach a diff so that you can offer some guidance/criticism/taunts!

This ticket was mentioned in IRC in #buddypress-dev by paulgibbs. View the logs.


10 years ago

#8 @DJPaul
10 years ago

  • Keywords commit added

Patch looks good.

#9 @djpaul
10 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 8762:

Activity: fix bug where activity comments were not being shown to anonymous users.

Fixes #5567, props wolfhoundjesse

#10 @DJPaul
10 years ago

Thanks so much for the patch, wolfhoundjesse :)

#11 @wrowlands
10 years ago

When will this fix be added to the plugin and distributed?

#12 @r-a-y
10 years ago

When will this fix be added to the plugin and distributed?

When v2.1 is released, which is scheduled around a month from now.

If you need to, you can roll the fix on your own install by copying the changes in r8762.

#13 @wrowlands
10 years ago

This worked GREAT! Thanks for your help.

Wayne

Note: See TracTickets for help on using tickets.