Skip to:

Opened 10 years ago

Closed 10 years ago

#5425 closed defect (bug) (fixed)

wp-admin/profile not saving all files since r7970

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch commit


since r7970, the wp-admin/profile is not working the right way.
I think it's due to the direct use of wp_parse_id_list() on $_POST['field_ids'].

As the wp-admin profile displays all groups of field on one page (which is not the case on front end), $_POST['field_ids'] is an array containing each group list of comma separated field ids.

For instance :
group base has 2 fields > id 1 and id 2
another group of fields have 1 field > id 3
Then the $_POST['field_ids'] is not 1,2,3 but array( 0 => "1,2", 1 => "3" ). So we first need to merge the values in a unique comma separated list before using wp_parse_id_list()

The patch is a way to come back from ("revenir en arrière par rapport à") r7970

Attachments (3)

5425.diff (1.2 KB) - added by imath 10 years ago.
5425.02.diff (751 bytes) - added by imath 10 years ago.
5425.03.diff (1.1 KB) - added by imath 10 years ago.

Download all attachments as: .zip

Change History (8)

10 years ago

10 years ago

#1 @imath
10 years ago

5425.02.diff seems better, it avoids a foreach.

#2 @boonebgorges
10 years ago

5425.02 seems fine to me.

10 years ago

#3 @imath
10 years ago

5425.03.diff is similar to 5425.02.diff. It simply adds a comment to explain why we need to merge the comma separated list of ids before using wp_parse_id_list(). I thought it would add to comprehension to also use implode's alias function join()

#4 @johnjamesjacoby
10 years ago

  • Keywords commit added

Works here. Go for it.

#5 @imath
10 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 8028:

Make sure all xprofile fields are saved in wp-admin/profile

Unlike front-end edit-fields screens, the wp-admin/profile displays all groups of fields on a single page. So the list of field ids is an array gathering for each group of fields a distinct comma separated list of ids. As a result, before using the wp_parse_id_list() function, we must ensure that these ids are merged into a single comma separated list.

Fixes #5425

Note: See TracTickets for help on using tickets.