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

FSE: Strip post ids from template part blocks on export. #26268

Merged
merged 2 commits into from
Nov 2, 2020
Merged

FSE: Strip post ids from template part blocks on export. #26268

merged 2 commits into from
Nov 2, 2020

Conversation

fklein-lu
Copy link
Contributor

This ensures that exported FSE themes work on other sites.

Description

Fixes the export of FSE themes so that they can be activated on other sites

How has this been tested?

Tested:

  1. Automated via a WP unit test.
  2. Manually by exporting a template with a template part on local, and verifying the output.

Types of changes

Bug fix: Fixes the issue outlined in #25845.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

This ensures that exported FSE themes work on other sites.
@fklein-lu fklein-lu changed the title Strip post ids from template part blocks on export. FSE: Strip post ids from template part blocks on export. Oct 20, 2020
@skorasaurus
Copy link
Member

Thanks for the PR.

I've tested it manually and functions as expected on my end; the postids are no longer included in the template-part.

(Made edits to the footer and header both through https://site.test/wp-admin/admin.php?page=gutenberg-edit-site and through https://site.test/wp-admin/edit.php?post_type=wp_template_part ; then exported the zip.

@gziolo gziolo added [Feature] Full Site Editing [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. labels Oct 28, 2020
@youknowriad
Copy link
Contributor

I'd love some thoughts about how to make this more generic across blocks. the same issue can happen for reusable blocks for instance and even more complex for image blocks (and other media blocks) where the id is in the markup.

@youknowriad
Copy link
Contributor

Thinking more, I guess you could argue that the template parts are a bit special in the sense that they are actually already exported as files to the themes. So yeah, this might have more priority.

I didn't test but I'm on board with this

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.

Let's get this in. Seems like a decent fix for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Experimental Experimental feature or API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants