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

Remove white spaces from theme slugs #244

Merged
merged 2 commits into from
Feb 27, 2023

Conversation

matiasbenedetto
Copy link
Contributor

@matiasbenedetto matiasbenedetto commented Feb 22, 2023

What?

  • Remove white spaces from the theme slug
  • Removing the removal of the key in the template parts links in templates because this is not necessary.

How to test?

Follow the steps detailed in the description of: #242

Fixes: #242

Copy link

@oskosk oskosk left a comment

Choose a reason for hiding this comment

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

This worked well for me following the steps of #242!

@matiasbenedetto matiasbenedetto merged commit cd9905d into trunk Feb 27, 2023
@madhusudhand madhusudhand deleted the fix/remove-white-spaces-in-theme-name branch February 28, 2023 05:22
@oskosk
Copy link

oskosk commented Feb 28, 2023

When testing this PR it worked for me. I copied the file's content and pasted it on a site running Create Block Theme 1.6.0...

But after 1.6.1 was released, I faced this bug again on a fresh site with Create Block Theme 1.6.1. The same steps as described in #242, but the template is now indeed exported referencing the part with spaces stripped on the theme attribute.

In this capture, I show the new site where I uploaded the recently generated theme from another site (with Create Block Theme 1.6.1).

You can see that the theme attribute is there without spaces, but the part does not render.

Edit: See #244 (comment)

Screen.Recording.2023-02-28.at.13.55.36.mov

@oskosk
Copy link

oskosk commented Feb 28, 2023

When testing this PR it worked for me. I copied the file's content and pasted it on a site running Create Block Theme 1.6.0...

I'm sorry, but I think I didn't test properly at the time. I just retested doing this ⬆️ and the problem persisted in 1.6.0 with the changes from the PR applied

Edit: See #244 (comment)

@oskosk
Copy link

oskosk commented Feb 28, 2023

Ok, I found out what happened. I was uploading a file named letheme (2).zip (a result of downloading multiple times) that ended up creating a folder named letheme-2 in the site, so the editor requests to wp-json/wp/v2/template-parts/letheme//header?context=edit&_locale=user were failing. Sorry for the noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export: Getting Template part has been deleted or is unavailable: header after uploading to a new site
3 participants