Skip to:

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#5672 closed defect (bug) (fixed)

Multiselect xprofile field does not save multiple values since 2.0 when using bp-default child theme

Reported by: kansas3d's profile kansas3d Owned by:
Milestone: 2.1 Priority: high
Severity: normal Version: 2.0
Component: Templates Keywords:


Im using the newest WordPress 3.9.1 and newest Buddypress 2.0.1 version.

The “Multi Select Box” doesn’t work. It doesn’t save multi selected fields.

When I’m adding under Users > Profile Fields
the Field Type “Multi Select Box” it doesn’t work as it should.

When I’m trying to select in the users profile some values, it is always just saving the first selected value.

The multi select box worked till Buddypress 1.9. But not since Buddypress 2.0 with the retirement of bp-default.

Since Buddypress 2.0 I had to create bp-custom.php to get my child-theme of bp-default theme back running like described on

Since then multi select boxes don’t work properly anymore. It works with the twenty fourteen theme just not bp-default anymore.
The problem just appears when trying to use bp-default with a child theme.

Looks like buddy press got a bug when doing this change with the retirement of bp-default.

Attachments (1)

5672.bp-default.patch (1.1 KB) - added by boonebgorges 10 years ago.

Download all attachments as: .zip

Change History (19)

#1 @DJPaul
10 years ago

  • Milestone changed from Awaiting Review to 2.0.2

I haven't tested this but moving to 2.0.2 for triaging.

#2 @mjc82in
10 years ago

  • Priority changed from normal to high

Can this be fixed Soon. This is kind of a big bug the way we are using it.


#3 @boonebgorges
10 years ago

  • Summary changed from Bug in bp-default since Buddypress 2.0 to Multiselect xprofile field does not save multiple values since 2.0 when using bp-default child theme

Changing the title of the ticket so it doesn't get lost in the shuffle.

#4 @boonebgorges
10 years ago

  • Component changed from Core to Theme


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.

#5 @DJPaul
10 years ago

My bad for breaking this. I agree with Boone's approach.

#6 @DJPaul
10 years ago

  • Milestone changed from 2.0.2 to 2.1
  • Resolution set to fixed
  • Status changed from new to closed

I've committed Boone's patch to BP-Default in 0031c22. It'll be included in BP 2.1.

#7 @mjc82in
10 years ago

I should be able to put this patch on my bp-default\functions.php and it should work for now right.

And when I upgrade to 2.1, when it releases, I should remove this and upgrade?


#8 @DJPaul
10 years ago

Yes. When you update BuddyPress, the version of BP-Default inside the BuddyPress folder will be deleted, and the new version will replace it. You won't need to undo these changes to be able to upgrade BuddyPress, if that's what you mean.

#9 @mjc82in
10 years ago

Still does not work I replaced the buddypress->bp-themes-bp->default->functions.php code with the above in 0031c22 link, and tested it still saves on the last one value. i.e. if three selected in a mulitselected page only the last one of them gets saved.

#10 @mjc82in
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#11 @mjc82in
10 years ago

Any idea what else might be wrong?

#12 @mjc82in
10 years ago

Any response on this I havent seen an update in a while.

#13 @boonebgorges
10 years ago

mjc82in - Please be patient. This project is maintained entirely by volunteers, and the current milestone has many dozens of open tickets.

If you find that the patch is not working for you, I'd ask you to do some further debugging to figure out the root of the problem. Because it's working for me, it's a bit difficult to guess why there are still problems on your end. The first thing to check, I'd say, is whether you are able to reproduce the problem with bp-default itself (instead of your child theme).

#14 @DJPaul
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

mjc82in - I'm going to close this as we've not had an update from you in a couple of weeks. Try with bp-default itself, as Boone suggests, rather than a child theme.

#15 follow-up: @mjc82in
10 years ago

I still waiting for this to be resolved. Its a key plugin of ours so currently a lot of people affected.

#16 in reply to: ↑ 15 @boonebgorges
10 years ago

Replying to mjc82in:

I still waiting for this to be resolved. Its a key plugin of ours so currently a lot of people affected.

We are still waiting for you to do some additional debugging, as requested here: As noted above, the fix committed to the bp-default repo fixes the problem in my tests. I would like you to verify whether that's the case for you (in which case the problem is with your theme) or whether you are still able to reproduce the problem on the bleeding edge version of bp-default (in which case there must be more details to reproducing than what's described above). In any case, it's not possible for our team to fix a problem that we cannot reproduce.

#17 @IvoPereira
9 years ago

Just to inform that I was having this issue, however, the patch provided worked flawlessly.

#18 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.