Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#42395 closed defect (bug) (fixed)

Customize: Starter content does not play nicely with drafted changes

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

Description

Open the customizer on a "fresh site" running twenty seventeen, and save your changes as a draft. each time you load the draft in the customizer after that, the starter content will be re-imported as new drafts. when the changeset is published, each copy of the imported starter content is published.

Attachments (3)

42395.0.wip.diff (4.1 KB) - added by westonruter 6 years ago.
https://github.com/xwp/wordpress-develop/pull/298
42395.diff (811 bytes) - added by dlh 6 years ago.
42395.3.diff (1.1 KB) - added by westonruter 6 years ago.

Download all attachments as: .zip

Change History (14)

#1 @westonruter
6 years ago

  • Keywords has-patch added

@dlh I have an initial patch which seems to fix the issue. See 42395.0.wip.diff. But it's not pretty. I'd appreciate your insights.

I'm not satisfied with the patch I have, as it is hacky and exposes some underlying problems with how we implemented settings for nav menus and nav menu items. In particular, we're including dynamic “generated” properties like original_title and type_label in the changeset value. These should be omitted and only dynamically added when the via the filter wp_setup_nav_menu_item, for example.

Last edited 6 years ago by westonruter (previous) (diff)

@dlh
6 years ago

#2 @dlh
6 years ago

Could we assume that a non auto-draft changeset no longer needs starter content imported, as sketched in 42395.diff?

#3 @westonruter
6 years ago

@dlh That's a great point. I was retaining the importing of starter content because I was thinking of the case where a user switches to a different theme that has starter content. But if you've saved a draft then you wouldn't be able to switch themes anymore anyway.

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


6 years ago

@westonruter
6 years ago

#5 @westonruter
6 years ago

  • Keywords dev-feedback added
  • Owner set to westonruter
  • Status changed from new to accepted

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


6 years ago

#7 @westonruter
6 years ago

  • Keywords commit added

#8 @joemcgill
6 years ago

  • Keywords dev-reviewed added; dev-feedback removed

Nice and clean. +1

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


6 years ago

#10 @obenland
6 years ago

Was able to reproduce and 42395.3.diff looks like a fine fix. 👍

#11 @westonruter
6 years ago

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

In 42107:

Customize: Prevent re-importing starter content when changeset is saved as draft or scheduled.

Themes cannot currently be switched in Customizer after changeset is saved anyway.

Props dlh, westonruter.
See #40146, #42411, #42126.
Fixes #42395.

Note: See TracTickets for help on using tickets.