Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates: Always parse blocks from content #9448

Merged
merged 1 commit into from
Aug 30, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Aug 29, 2018

Fixes #9433

This pull request seeks to resolve an issue where no demo content is shown on the demo screen. It does without sacrificing the original intent of #9288, which had been the cause for the regression described by #9433.

Post content is always parsed, regardless of whether a template is assigned or the post is new or being edited. This allows the initial demo content to be parsed as blocks.

If a template exists and the post is new, only then is the template applied by synchronizing. In most cases, the initial content would have been empty and the blocks an empty array (as had existed in previous logic), but this also accounts for potential divergences between content of the new post and the template.

Testing instructions:

Repeat steps to reproduce from #9433, verifying demo content is shown.

Repeat testing instructions from #9288.

Ensure end-to-end tests pass:

npm run test-e2e

@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] Templates API Related to API powering block template functionality in the Site Editor labels Aug 29, 2018
@aduth aduth added this to the 3.7 milestone Aug 29, 2018
@aduth aduth requested a review from youknowriad August 29, 2018 22:24
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit code-wise. Can't test at the moment though. Feel free to merge if you're confident otherwise I'll test tomorrow.

@youknowriad
Copy link
Contributor

Tested and confirmed that it works great.

@youknowriad youknowriad merged commit bf2ce55 into master Aug 30, 2018
@youknowriad youknowriad deleted the fix/9433-template-new-post branch August 30, 2018 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demo: No content on demo page
2 participants