Opened 2 years ago

Closed 2 years ago

#16673 closed defect (bug) (fixed)

_wp_translate_data() shouldn't set fields to empty values

Reported by: scribu Owned by: scribu
Priority: normal Milestone: 3.2
Component: Administration Version:
Severity: normal Keywords: has-patch
Cc: solaris.smoke@…, mikeschinkel@…

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

scribu2 years ago

  • Cc solaris.smoke@… added
  • Cc mikeschinkel@… added

+1

  • Milestone changed from Future Release to 3.2
  • Owner set to scribu
  • Status changed from new to accepted

Refresh

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

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

comment:6   ryan2 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

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: ↓ 8   solarissmoke2 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   westi2 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.