WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#16673 closed defect (bug) (fixed)

_wp_translate_data() shouldn't set fields to empty values

Reported by: scribu Owned by: scribu
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

In _wp_translate_data(), there are 3 fields which are always set, regardless if their $_POST key wasn't set originally.

This prevents the array_merge() in wp_update_post() from working properly.

Example: If a custom post type doesn't support excerpts, they will be overwritten if you set them through another method.

In #13179, this was resolved by adding hidden inputs, which is kind of backwards.

Attachments (3)

16673.diff (1.1 KB) - added by scribu 4 years ago.
16673.2.diff (1.6 KB) - added by johnjamesjacoby 4 years ago.
Refresh
revert-13179.diff (801 bytes) - added by solarissmoke 4 years ago.
Don't need to have hidden input any more as we not longer set post_parent to empty if it's not POSTed

Download all attachments as: .zip

Change History (11)

@scribu4 years ago

comment:1 @solarissmoke4 years ago

  • Cc solaris.smoke@… added

comment:2 @mikeschinkel4 years ago

  • Cc mikeschinkel@… added

+1

comment:3 @scribu4 years ago

  • Milestone changed from Future Release to 3.2

comment:4 @scribu4 years ago

  • Owner set to scribu
  • Status changed from new to accepted

@johnjamesjacoby4 years ago

Refresh

comment:5 @johnjamesjacoby4 years ago

Patch refreshed. scribu's wouldn't apply for me.

In 16673.2.diff, I also cast parent_id as integer.

comment:6 @ryan4 years ago

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

In [18082]:

Don't set fields to empty values in _wp_translate_data(). Props scribu, johnjamesjacoby. fixes #16673

@solarissmoke4 years ago

Don't need to have hidden input any more as we not longer set post_parent to empty if it's not POSTed

comment:7 follow-up: @solarissmoke4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I believe this means we can revert the changes made by #13179 ?

comment:8 in reply to: ↑ 7 @westi4 years ago

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

Replying to solarissmoke:

I believe this means we can revert the changes made by #13179 ?

Please open a new ticket for this.

Note: See TracTickets for help on using tickets.