#7472 closed defect (bug) (fixed)
Admin - Cannot edit profile fields when on multisite and BP is not network-activated
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.8.3 | Priority: | high |
Severity: | major | Version: | 2.8.2 |
Component: | Administration | Keywords: | has-patch |
Cc: |
Description
Hello,
On the "User Fields Management" page, when the plugin is not activated on the network, you can not modify or delete a field. (wp-admin/users.php?page=bp-profile-setup)
I solved the problem by correcting the lines 616 and 626 of file buddypress/bp-xprofile/bp-xprofile-admin.php.
Replace : network_admin_url by admin_url
<?php $field_edit_url = add_query_arg( array( 'page' => 'bp-profile-setup', 'group_id' => (int) $field->group_id, 'field_id' => (int) $field->id, 'mode' => 'edit_field' ), admin_url( 'users.php' ) ); if ( $field->can_delete ) { $field_delete_url = add_query_arg( array( 'page' => 'bp-profile-setup', 'field_id' => (int) $field->id, 'mode' => 'delete_field' ), admin_url( 'users.php' ) . '#tabs-' . (int) $field->group_id ); }
]
Think you correct it?
Thank you
Attachments (1)
Change History (10)
#1
@
8 years ago
Hi @NicolasKulka-
Thanks for your patch! Looking into network_admin_url()
, it should fall back to using admin_url()
if is_multisite()
returns false:
https://developer.wordpress.org/reference/functions/network_admin_url/
Before you made the change, what URLs were being produced by the function? (Can you provide an example?)
Best,
-David
#2
@
8 years ago
- Component changed from Core to Administration
- Milestone changed from Awaiting Review to 2.8.3
- Owner set to slaFFik
- Summary changed from Law problem on the user field page to Admin - Cannot edit profile fields when on multisite and BP is not network-activated
See #7445 where I made the change to use network_admin_url()
.
Looks like @NicolasKulka is using multisite, but has only activated BuddyPress on one site. This would cause the bug that he is experiencing.
Boo Ray!
@johnjamesjacoby was right that we should probably use bp_get_admin_url()
. See his comment here:
https://buddypress.trac.wordpress.org/ticket/7445#comment:7
@NicolasKulka - Can you check to see if using bp_get_admin_url()
will fix your problem?
#3
@
8 years ago
- Owner changed from slaFFik to r-a-y
- Status changed from new to reviewing
Sorry, didn't mean to assign to slaFFik. For some reason, Trac made that change when I posted.
#5
@
8 years ago
- Status changed from reviewing to accepted
Thanks for verifying, @NicolasKulka.
Going to commit this now.
Patch