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

Fix double replacement in replace_namespace #389

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

jffng
Copy link
Contributor

@jffng jffng commented Jun 5, 2023

Fixes #387. This PR alters the replace_namespace function to use placeholders before performing the actual string replacement.

When performing multiple replacements in the same string, some of the replacements can result in a string that matches an earlier search pattern. I think this is what's happening in #387.

To test
Follow the instructions in 387 on trunk and this PR, verify you don't get duplicated aspects of the old theme slug in the new theme slug.

@jffng jffng requested review from carolinan and pbking June 5, 2023 15:02
@pbking
Copy link
Contributor

pbking commented Jun 5, 2023

I was finally able to reproduce this!

Thank you for your persistence in debuggin it @jffng and once I saw the fix I understood what I was missing in my steps to reproduce.

This fixes the issue for me.

@jffng jffng merged commit 66f4768 into trunk Jun 5, 2023
@jffng jffng deleted the fix/namespace-double-replacement branch June 5, 2023 20:43
@carolinan
Copy link

Thank you!

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.

Site Editor Plugin sidebar: Clone: Theme Name is duplicated
3 participants