Skip to:
Content

BuddyPress.org

Opened 12 months ago

Closed 7 months ago

#9297 closed defect (bug) (fixed)

"Profile Visibility" settings link causes 404 when Extended Profiles is disabled

Reported by: joelkarunungan Owned by: espellcaste
Priority: normal Milestone: 14.5.0
Component: Settings Version:
Severity: normal Keywords: has-patch needs-testing
Cc:

Description

After disabling the Extended Profiles component (via wp-admin → Settings → BuddyPress → Components), the "Profile Visibility" link still appears under the user settings navigation (e.g., /members/username/settings/profile/).

Since Extended Profiles is disabled, clicking this link results in a 404 error.

Expected behavior:
The "Profile Visibility" tab should be automatically removed when the Extended Profiles (xprofile) component is not active, as it depends on that module to function.

Current workaround:
I’m using the following code to manually remove the nav item:

add_action( 'bp_actions', function() {
    bp_core_remove_subnav_item( 'settings', 'profile', 'members' );
}, 99 );

It would be great if BuddyPress could automatically hide this settings tab when the associated component is disabled, to avoid broken links and improve UX.

Change History (7)

This ticket was mentioned in PR #414 on buddypress/buddypress by @nikunj8866.


12 months ago
#1

  • Keywords has-patch added

#2 @nikunj8866
12 months ago

  • Keywords needs-testing dev-feedback added

#3 @nikunj8866
11 months ago

  • Keywords dev-feedback removed

#4 @espellcaste
7 months ago

  • Component CoreSettings
  • Milestone Awaiting Review14.5.0

I can confirm this. Good catch. The patch looks good. But I'll take another look soon.

#5 @vapvarun
7 months ago

Tested this locally and can confirm the fix works. With Extended Profiles disabled, the Profile Visibility link no longer appears in Settings nav, and no more 404.

The fix is straightforward - just wrap the subnav registration in bp_is_active( 'xprofile' ). Makes sense since bp_xprofile_screen_settings wouldn't exist without the component anyway.

Thanks @developer06 for the report and @nikunj8866 for the patch!

#6 @espellcaste
7 months ago

In 14178:

When the Extended Profiles component is disabled, the "Profile Visibility" settings link does not 404.

The "Profile Visibility" link, members/user/settings/profile/, relies on the Extended Profiles component to work properly. When this component is disabled, the link should not added to the user profile settings menu.

We also did the same for the Email link. So that it is added only when the Notifications component is enabled.

Developed at https://github.com/buddypress/buddypress/pull/414/

Props joelkarunungan, nikunj8866, and vapvarun.

See #9297 (14.0)

#7 @espellcaste
7 months ago

  • Owner set to espellcaste
  • Resolutionfixed
  • Status newclosed

In 14179:

When the Extended Profiles component is disabled, the "Profile Visibility" settings link does not 404.

The "Profile Visibility" link, members/user/settings/profile/, relies on the Extended Profiles component to work properly. When this component is disabled, the link should not added to the user profile settings menu.

We also did the same for the Email link. So that it is added only when the Notifications component is enabled.

Props joelkarunungan, nikunj8866, and vapvarun.

Closes https://github.com/buddypress/buddypress/pull/414/
Fixes #9297 (trunk)

Note: See TracTickets for help on using tickets.