[buddypress-trac] [BuddyPress Trac] #5809: Get displayed user ID early in Extended Profile

buddypress-trac noreply at wordpress.org
Wed Aug 13 10:11:50 UTC 2014


#5809: Get displayed user ID early in Extended Profile
-------------------------+-----------------------------
 Reporter:  Offereins    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  XProfile     |    Version:  2.0
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 Setting the stage:
 In Dashboard > User > Extended Profile, the admin page is built with
 metaboxes in `BP_Members_Admin::user_admin_load()` using the
 `bp_members_admin_user_metaboxes` action hook. The XProfile component
 makes use of this by adding meta boxes for each of the profile fieldgroups
 in `BP_XProfile_User_Admin::register_metaboxes()`. The fieldgroups are
 collected through `bp_has_profile()` which uses the new (BP 2.1)
 `bp_xprofile_get_groups()`.

 The issue:
 While the edited user ID is provided in the metaboxes hook,
 `bp_has_profile` here does not use that ID to setup the
 `$profile_template` global, but instead uses `bp_displayed_user_id()` in
 `bp_xprofile_get_groups`. The thing is, that this function returns `0`
 (empty) on this point, because the displayed user ID is not set. Yet, in
 `BP_Members_Admin::get_user_id()` the edited user ID is found in the uri
 query args with `$_GET`. Later on in the admin page,
 `bp_displayed_user_id()` does return the right user ID.

 The solution:
 By sending the edited user ID from the action hook to `bp_has_profile()`,
 the function will not default to `bp_displayed_user_id()`. Yet,
 `bp_displayed_user_id()` still fails around here.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5809>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list