[buddypress-trac] [BuddyPress Trac] #5672: Multiselect xprofile field does not save multiple values since 2.0 when using bp-default child theme
buddypress-trac
noreply at wordpress.org
Thu Jul 17 02:43:47 UTC 2014
#5672: Multiselect xprofile field does not save multiple values since 2.0 when
using bp-default child theme
--------------------------+--------------------
Reporter: kansas3d | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 2.0.2
Component: Theme | Version: 2.0
Severity: normal | Resolution:
Keywords: |
--------------------------+--------------------
Changes (by boonebgorges):
* component: Core => Theme
Comment:
Confirmed.
The problem is that `<select>` elements will only send an array value in a
`<form>` submit if their name has trailing `[]` brackets. Prior to BP 2.0,
we had logic in `bp_get_the_profile_field_input_name()` that checked
specifically for this issue, and added the brackets if necessary. In BP
2.0, the check was removed from the template function, and into the
`BP_XProfile_Field_Type_Multiselectbox` class. However, bp-default does
not use this class to build its multiselect markup; it calls
`bp_get_the_profile_field_input_name()` directly from the template. So the
brackets are missing.
I thought about adding the brackets directly to
/members/single/profile/edit.php, but that change would not be inherited
by child themes that override this template. So, instead, I suggest the
attached patch *for bp-default*, which filters the `'name'` and adds
brackets as necessary. This seems to me like the right place to fix the
issue, but I'd like a sanity check from DJPaul on this one.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5672#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list