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

Patterns: Unable to duplicate the pattern without categories #54729

Closed
t-hamano opened this issue Sep 22, 2023 · 0 comments · Fixed by #54755
Closed

Patterns: Unable to duplicate the pattern without categories #54729

t-hamano opened this issue Sep 22, 2023 · 0 comments · Fixed by #54755
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

Description

When trying to duplicate a pattern that does not have a category in the Site Editor, an error is displayed in the snack bar and the pattern is not duplicated.

After investigating, it seems that the cause is that the categories variable becomes undefined here:

async function getCategories( categories ) {
const terms = categories.map( ( category ) => {

Step-by-step reproduction instructions

  • In the Site Editor, create a pattern without adding categories.
  • Attempt to duplicate the pattern.
  • There should be an error.
  • Add a category to the pattern and save it.
  • This time, you should be able to successfully replicate the pattern.

Screenshots, screen recording, code snippet

52047a4c5bd2af427aafa1bbdb80b53c.mp4

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Sep 22, 2023
@t-hamano t-hamano linked a pull request Sep 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant