WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 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 6 years ago.
16673.2.diff (1.6 KB) - added by johnjamesjacoby 6 years ago.
Refresh
revert-13179.diff (801 bytes) - added by solarissmoke 6 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)

@scribu
6 years ago

#1 @solarissmoke
6 years ago

  • Cc solaris.smoke@… added

#2 @mikeschinkel
6 years ago

  • Cc mikeschinkel@… added

+1

#3 @scribu
6 years ago

  • Milestone changed from Future Release to 3.2

#4 @scribu
6 years ago

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

@johnjamesjacoby
6 years ago

Refresh

#5 @johnjamesjacoby
6 years ago

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

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

#6 @ryan
6 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

@solarissmoke
6 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

#7 follow-up: @solarissmoke
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

#8 in reply to: ↑ 7 @westi
6 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.