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

Custom template parts can't be renamed from the template parts list #47915

Closed
afercia opened this issue Feb 9, 2023 · 2 comments · Fixed by #47932
Closed

Custom template parts can't be renamed from the template parts list #47915

afercia opened this issue Feb 9, 2023 · 2 comments · Fixed by #47932
Assignees
Labels
[Package] Edit Site /packages/edit-site [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Feb 9, 2023

Description

In the Site Editor, both custom templates and custom template parts can be renamed from the 'template details' dropdown:

Screenshot 2023-02-09 at 10 36 22

Screenshot 2023-02-09 at 10 40 16

Instead, in the templates / template parts list, only custom templates can be renamed. In the template parts list, the 'Rename' Action for custom template parts is missing. The Actions dropdown menu only shows the 'Delete' action:

Templates list:

Screenshot 2023-02-09 at 10 40 55

Template parts list:

Screenshot 2023-02-09 at 10 41 16

It appears the RenameMenuItem component returns early if the template is_custom prop does not exists. To my understanding the is_custom prop exists only for templates. It doesn't for template parts/ Therefore, the 'Rename' action is not shown.

Everything else seems to be in place: when commenting out the early return, the Rename action does show and appears to work as expected.

Cc @Mamaduka

Step-by-step reproduction instructions

  • Go to the Site Editor.
  • Create a custom template and a custom template parts.
  • Edit them and observe it is possible to rename both from the 'template details' dropdown in the top bar.
  • Go to Templates > Manage all templates.
  • In the Templates list, click the Actions button for the custom template.
  • Observe there is a 'Rename' action.
  • Go to Template parts > Manage all template parts.
  • In the Template parts list, click the Actions button for the custom template part.
  • Observe there is no 'Rename' action.

Screenshots, screen recording, code snippet

No response

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

@afercia afercia added [Type] Bug An existing feature does not function as intended [Package] Edit Site /packages/edit-site labels Feb 9, 2023
@afercia
Copy link
Contributor Author

afercia commented Feb 9, 2023

Related: #36911

@Mamaduka
Copy link
Member

Mamaduka commented Feb 9, 2023

Tanks for catching the bug, @afercia!

I’ll have PR ready before Beta 2.

@Mamaduka Mamaduka self-assigned this Feb 9, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 9, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Edit Site /packages/edit-site [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants