Skip to:

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5511 closed defect (bug) (fixed)

xprofile wp-admin shows duplicate fields for pre-2.0 custom field types

Reported by: DJPaul Owned by: DJPaul
Milestone: 2.0 Priority: normal
Severity: normal Version: 2.0
Component: Extended Profile Keywords: needs-testing has-patch


The plugin implements several custom field types. As it was written before 2.0, it's a good test that the xprofile field type re-implementation hasn't caused any regressions or breaks in backwards compatibility.

I've been in touch with the author of that plugin via email (hi Miguel!) who is testing trunk, and there's an issue in the display of the custom field types in the wp-admin profile fields management screen. The custom field types (not registered into BP in the new 2.0 style) show the custom template, along with the default textbox. Screenshot: -- the unwanted textboxes are on the left, and the custom field type's template on the right.

It's showing the default textbox because that's what the field type class defaults to if you tell it to create a field type that it doesn't know about.

This regression's been introduced because it looks like I mis-read a switch statement in the xprofile_admin_field() function; it looks like a relatively simple fix. I've attached a patch here which works for me, and I'm going to ask Miguel to get it before I commit it.

Attachments (1)

5511.01.patch (799 bytes) - added by DJPaul 7 years ago.

Download all attachments as: .zip

Change History (6)

7 years ago

#1 @DJPaul
7 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

#2 @DJPaul
7 years ago

I am going to commit this in for beta 2 even though I haven't confirmation from the reporter that the bug's fixed (it works correctly in my testing).

#3 @djpaul
7 years ago

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

In 8232:

xProfile: fix regression in wp-admin field types screen where duplicate field templates were being shown for pre-2.0 custom field types.

A switch statement in the original xprofile_admin_field() was mis-read and an action was being triggered when it shouldn't have, causing the field templates to double up.
Fixes backwards compatibility with existing plugins that add custom field types.

Fixes #5511

#4 @atallos
7 years ago

Great work! It's working as expected now I think.

#5 @DJPaul
7 years ago

Wonderful - thanks for testing :)

Note: See TracTickets for help on using tickets.