WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 3 weeks ago

#42413 closed defect (bug) (fixed)

Customize: Export the current changeset's date if it's in the future

Reported by: dlh Owned by: westonruter
Milestone: 4.9 Priority: low
Severity: normal Version: 4.9
Component: Customize Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

There seems to be a slight difference in behavior between the Publish Settings in the Customizer and the edit-post screen in this scenario:

  1. Schedule a changeset.
  1. Switch the changeset to a draft and save again.
  1. Exit the Customizer and open it again later such that the changeset draft is loaded.

If you go back to the Publish Settings and select "Schedule," the date shown will be the current date and time, not the actual date of the changeset post in the database (which is the date for which the changeset was previously scheduled). By contrast, the edit-post screen will show the database date.

WP_Customize_Manager::customize_pane_settings() will currently export the date of the changeset post if its status is future. The attached patch would instead check that the changeset post's date is in the future, regardless of post status. (Exporting a date in the past doesn't seem to make sense because scheduling a changeset with a past date is blocked, not published immediately.)

Attachments (3)

42413.diff (693 bytes) - added by dlh 3 weeks ago.
42413.2.diff (1.4 KB) - added by westonruter 3 weeks ago.
42413.3.diff (1.4 KB) - added by westonruter 3 weeks ago.
Move condition

Download all attachments as: .zip

Change History (10)

@dlh
3 weeks ago

#1 @westonruter
3 weeks ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to westonruter
  • Status changed from new to accepted

@westonruter
3 weeks ago

#2 @westonruter
3 weeks ago

  • Keywords commit dev-feedback added

This ticket was mentioned in Slack in #core-committers by westonruter. View the logs.


3 weeks ago

#4 @westonruter
3 weeks ago

  • Priority changed from normal to low

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


3 weeks ago

#6 @obenland
3 weeks ago

  • Keywords dev-reviewed added; dev-feedback removed

42413.2.diff works, but you could probably move the $initial_date < $current_time conditional inside the $changeset_post condition. It doesn't seem to be relevant outside of it.

@westonruter
3 weeks ago

Move condition

#7 @westonruter
3 weeks ago

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

In 42109:

Customize: Always use underlying changeset post date as initial date in scheduled date fields if date is future.

Prevent user from having to re-enter the previously-supplied future date if they had switched from schedule to draft but wanted to switch back again. Improves parity with behavior of post edit screen.

Props dlh, westonruter, obenland.
See #39896, #28721.
Fixes #42413.

Note: See TracTickets for help on using tickets.