Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7428 closed defect (bug) (fixed)

XProfile: a group's first field becomes last after save

Reported by: SGr33n Owned by: offereins
Priority: normal Milestone: 2.8
Component: Extended Profile Version:
Severity: normal Keywords:
Cc: lmoffereins@…

Description

Hi,
Looks strange nobody yet reported this, I searched but nothing similar found, so sorry if it's a duplicate.
Anyway when you have multiple profile fields, if you update the "Name" field (the main field, the one with id 0 on the bp_xprofile_fields table) it will order automatically as last. I took a look at the DB and on the bp_xprofile_fields table the field_order becames e.g. 3 in a 3 fields configuration.

Thanks

Attachments (1)

7428.01.patch (822 bytes ) - added by Offereins 10 years ago.

Download all attachments as: .zip

Change History (8)

#1 @dontdream
10 years ago

I've seen that happen with other profile fields too. After updating an existing profile field, *sometimes* I've seen it move to the last position in its field group.

I didn't submit a bug report because I wasn't able to consistently reproduce the issue, but now I confirm I can reproduce it editing the Name field (field_id=1).

Version 0, edited 10 years ago by dontdream (next)

#2 @DJPaul
10 years ago

  • Component CoreExtended Profile
  • Keywords good-first-bug added
  • Milestone Awaiting Review2.9

Yep. Good report, I can recreate too.

#3 @Offereins
10 years ago

  • Cc lmoffereins@… added

For a long time I've tolerated this bug, but the time has come to fix it. My first guess would be that the zero-based indexing of fields within the fieldgroup (this concerns all fieldgroups) is to blame. BP's logic would read that the field your editing has a falsey value for $field_order, thus BP considers it new and pushes it to the end of the field list. Will investigate further.

Edit: my guess was correct. Patch incoming.

Last edited 10 years ago by Offereins (previous) (diff)

@Offereins
10 years ago

#4 @Offereins
10 years ago

  • Keywords has-patch added; good-first-bug removed

I've attached the smallest patch possible which fixes the bug described. Further sanitization of data types is needed in the saving of profile fields (and groups), but that's for later.

#5 @boonebgorges
10 years ago

I've noticed this too. The approach in 7428.01.patch seems sensible as a first step toward better sanitization.

#6 @offereins
10 years ago

  • Owner set to offereins
  • Resolutionfixed
  • Status newclosed

In 11409:

XProfile: keep the field order value on save

Fixes a bug where the group's first field would be pushed to the bottom of
the field order stack on field save.

Fixes #7428

#7 @Offereins
10 years ago

  • Keywords has-patch removed
  • Milestone 2.92.8
  • Summary Modifing the Name user profile fieldXProfile: a group's first field becomes last after save
Note: See TracTickets for help on using tickets.