Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 6 months ago

#8133 closed defect (bug) (fixed)

Broken dropdown filter on friends page with a custom friends slug

Reported by: mattneil Owned by: imath
Milestone: 8.0.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Templates Keywords: has-patch commit
Cc:

Description

I set a custom BP_FRIENDS_SLUG, and the dropdown filter on my new friends page was empty.

It appears to be working after I replaced 'friends' with my new slug on lines 2021, 2064 and 2106 of bp-templates/bp-nouveau/includes/template-tags.php and lines 538 and 539 of bp-templates/bp-nouveau/includes/functions.php.

Attachments (2)

8133.patch (7.0 KB) - added by imath 2 years ago.
8133.2.patch (11.8 KB) - added by imath 6 months ago.

Download all attachments as: .zip

Change History (8)

#1 @mattneil
2 years ago

  • Summary changed from No dropdown filter on friends page with a custom friends slug to Broken dropdown filter on friends page with a custom friends slug

#2 @imath
2 years ago

  • Component changed from Core to Templates
  • Keywords needs-patch added
  • Version set to 3.0.0

Hi @mattneil

Thanks a lot for your feedback. I've just tested and was able to reproduce the issue. This is a bug specific to the BP Nouveau Template pack.

I'm working on a fix. I will keep you updated about my progress.

@imath
2 years ago

#3 @imath
2 years ago

  • Keywords has-patch needs-testing early added; needs-patch removed
  • Milestone changed from Awaiting Review to Up Next
  • Owner set to imath
  • Status changed from new to assigned

I'm sorry @mattneil fixing this issue will require more testing and we're too close to release 5.0.0 to take the risk to break the dropdown for the majority of users that don't customize slugs this way.

I've quickly built a patch to fix the bug, but we'll need to improve it and test potential regressions. We'll work on it during our next major development cycle (6.0.0).

#4 @imath
10 months ago

  • Milestone changed from Up Next to 8.0.0

@imath
6 months ago

#5 @imath
6 months ago

  • Keywords commit added; needs-testing early removed

8133.2.patch is a lot better than the first patch. It's fixing the issue for all slugs that are customizable using a specific constant. I'll commit it asap.

#6 @imath
6 months ago

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

In 12892:

Nouveau: improve the way customizable slugs are handled

BuddyPress uses constants such as BP_FRIENDS_SLUG to let advanced users customize component URL slugs. The Nouveau template pack was wrongly checking hardcoded component names at various places into its code, in particular into the following functions and template tags:

  • bp_nouveau_current_object()
  • bp_nouveau_filter_options()
  • bp_nouveau_wrapper()

This commit also introduces a new BP Core function to get the active BP Component objects: bp_core_get_active_components(). The $args argument can be used to filter the active components according to their slugs, names, ids or root slugs. Nouveau uses it to determine the component ID out of its slug and use this component ID instead of slugs to create its needed dynamic selectors, classes and data attributes.

Props mattneil

Fixes #8133

Note: See TracTickets for help on using tickets.