šŸ”„ HOT: Ticket/ - Complete Album!

Skip to:

Opened 5 months ago

Closed 3 days ago

#9297 closed defect (bug) (fixed)

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

Reported by: joelkarunungan's profile joelkarunungan Owned by: espellcaste's profile espellcaste
Milestone: 14.5.0 Priority: normal
Severity: normal Version:
Component: Settings 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.


5 months ago
#1

  • Keywords has-patch added

#2 @nikunj8866
5 months ago

  • Keywords needs-testing dev-feedback added

#3 @nikunj8866
5 months ago

  • Keywords dev-feedback removed

#4 @espellcaste
6 days ago

  • Component changed from Core to Settings
  • Milestone changed from Awaiting Review to 14.5.0

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

#5 @vapvarun
4 days 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
3 days 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
3 days ago

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

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.