Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

#7813 closed defect (bug) (fixed)

BP Nouveau: Group activity buttons actions are not working when set options to customizer

Reported by: dunhakdis's profile dunhakdis Owned by: imath's profile imath
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Templates Keywords: has-patch commit
Cc:

Description

No plugins installed aside from BuddyPress itself (BuddyPress 3.0 Beta2), using the theme TwentySixteen

Scenario:

1: Go to wp-admin > appearance > customizer > buddypress nouveau > group front page > enable custom front pages for groups (unchecked)

Will return the following (screenshot below):

https://i.imgur.com/UKBcYgT.png

2: Go to wp-admin > appearance > customizer > buddypress nouveau > group front page > enable custom front pages for groups (checked)

  • Activity link in nav appears and actions is now properly working. Home link in nav is set to custom:

https://i.imgur.com/meAbrJX.png


Thanks!

Attachments (3)

7813.patch (1004 bytes) - added by dunhakdis 7 years ago.
A better solution is recommended. Thanks!
7813-new-diff.diff (938 bytes) - added by dunhakdis 7 years ago.
7813-new-diff-2.diff (589 bytes) - added by dunhakdis 7 years ago.
New patch file. Cheers

Download all attachments as: .zip

Change History (7)

@dunhakdis
7 years ago

A better solution is recommended. Thanks!

#1 @imath
7 years ago

  • Component changed from Groups to Templates
  • Keywords needs-refresh reporter-feedback added; has-patch removed

Hi @dunhakdis

Nice catch, i confirm the issue ! Thanks a lot for the patch, i think we can improve it a bit :)

If you look into src/bp-core/bp-core-template.php you'll find some conditional tags eg: bp_is_group() is checking the loaded page belongs to a Group. The conditional tag bp_is_group_activity() should be a nice replacement to the if statement you edited at line 241 ('groups' === bp_current_component() && in_array( bp_current_action(), $activity_actions_in_groups ) ))

Then we can save the 2 lines of code you added to define $activity_actions_in_groups.

Can you update the patch this way ?

#2 @dunhakdis
7 years ago

  • Keywords has-patch added

Cool! I completely forget about bp_is_group_activity(). I also think that we can completely omit the'groups' === bp_current_component() condition since bp_is_group_activity() is already checking whether the current component belongs to 'groups' via bp_is_groups_components()

I'll attach a new diff file shortly. Thanks!

@dunhakdis
7 years ago

New patch file. Cheers

#3 @imath
7 years ago

  • Keywords commit added; needs-refresh reporter-feedback removed
  • Owner set to imath
  • Status changed from new to assigned

Great! Thanks a lot for the update. Let's have it in!

#4 @imath
7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 12075:

BP Nouveau - Customizer: improve Group activity stream preview.

Single Group Activity stream was missing a class when the Group front page Customizer setting was disabled. In this particular case, the Group home page is the Group Activity stream page. The class was not added because the current action is not "activity" but "home". Using the bp_is_group_activity() conditional tag solves the issue.

Props dunhakdis

Fixes #7813

Note: See TracTickets for help on using tickets.