[buddypress-trac] [BuddyPress Trac] #5666: "Settings > Profile" hidden field doesn't list all field IDs

buddypress-trac noreply at wordpress.org
Wed May 28 22:58:00 UTC 2014


#5666: "Settings > Profile" hidden field doesn't list all field IDs
--------------------------+-----------------------
 Reporter:  r-a-y         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  2.1
Component:  XProfile      |    Version:  2.0
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------
 If you're on your "Settings > Profile" Page, we output a hidden field to
 keep track of the number of xprofile field IDs that are rendered:

 `<input type="hidden" name="field_ids" id="field_ids" value="<?php
 bp_the_profile_group_field_ids(); ?>" />`

 The problem with this is `bp_the_profile_group_field_ids()` only
 recognizes the last profile group loop and not all profile groups.

 Case-in-point, when there is more than one xprofile group, only the fields
 from the last xprofile group are listed in the hidden field.  This means
 that a user is unable to set the visibility for any field in the first
 profile field group.

 ----

 To fix this, I wanted to get rid of the `bp_the_profile_group_field_ids()`
 function when rendering the hidden field, but that might lead to backpat
 issues for themes that are already using this template.

 So the attached patch:

 * Adds a filter to `bp_get_the_profile_group_field_ids()`
 * Records all the field IDs when on a user's "Settings > Profile" page
 using the new `bp_xprofile_settings_record_all_group_field_ids()` function
 * Overrides the `bp_get_the_profile_group_field_ids()` value with the
 recorded value

 If there is going to be an interim 2.0.2 release, this should also be part
 of that.

 Let me know what you think.

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


More information about the buddypress-trac mailing list