#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 | Owned by: | |
---|---|---|---|
Milestone: | 2.1 | Priority: | high |
Severity: | normal | Version: | 2.0 |
Component: | Templates | Keywords: | |
Cc: |
Description
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 https://buddypress.org/support/topic/bp-default-parent-theme-missing/.
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)
Change History (19)
#2
@
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.
Thanks
Manoj
#3
@
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
@
10 years ago
- Component changed from Core to Theme
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.
#6
@
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
@
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?
Thanks
Manoj
#8
@
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
@
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.
#13
@
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
@
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:
↓ 16
@
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
@
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: https://buddypress.trac.wordpress.org/ticket/5672?replyto=15#comment:13. 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.
I haven't tested this but moving to 2.0.2 for triaging.