Closed westonruter closed 7 years ago
I think the code was adding status(revision) to request only when we change status from drop down. @sayedtaqui Can you update such that it pass status when saved explicitly?
I think this is a better approach than doing it via just JS.
I think checking the param customize_snapshots_create_revision
is smarter than removing customize_changeset_status
plus this
isSameStatus = api.state( 'changesetStatus' ).get() === originalOptions.data.customize_changeset_status
would return true in case of existing changeset which has draft
status so creating revision for the first time makes perfect sense
Looks good đź‘Ť
@sayedtaqui I'm noticing something else here that is unexpected. If I open the customizer, change a setting, and then save the changeset as a draft; then if I click the edit icon, and then try supplying a title the changed title won't get saved until I try making another change to settings. In other words, it doesn't seem that the title changes are getting sent on change
as expected.
Are you able to tie up the lose ends on this ticket, including sending the flag to indicate a revision should be made, as well as ensuring changes to the title cause a title update to be sent? Also, related is #112 where the date fields are being unexpectedly shown.
Sure working on them.
try supplying a title the changed title won't get saved until I try making another change to settings. In other words, it doesn't seem that the title changes are getting sent on change as expected.
@westonruter The title would not get saved if the date is not of future, once user updates the date to be of future, it will start auto-saving, but yes it should be happening only in case of future, which I have updated. Now working on the main issue..
@westonruter I wasn't able to finish it today, and I am going on a leave till next Tuesday, so may be @PatelUtkarsh can continue on this PR or I can do it when I come back. đź‘‹
@westonruter Ready for review.
@sayedtaqui On 4.6 I'm getting an error if I Save a snapshot, then make a change, and then hit Update. A modal pops open with “The snapshot could not be saved”, with the Ajax request returning with a bad_schedule_time
error.
Found a bug with 0.6.0-rc1 whereby revisions were no longer being made as expected when explicitly clicking the Save Draft button in the UI. The opt-in for creating a revision in core is currently indicated by whether or not a
customize_changeset_status
param is present. This is not ideal, but since the param is getting stripped by Customize Snapshots if the status is the same as the current status, I added a workaround for this to explicitly indicate the need to create a revision via another channel. There is probably a better solution for this, not at least to allow asave_revision
to be passed when callingwp.customize.previewer.save()
.See: https://github.com/WordPress/wordpress-develop/blob/8900e2466e3a01c9c228ac31784aa70e8dcf3137/src/wp-includes/class-wp-customize-manager.php#L2279