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

Template Editor toolbar dropdown broken #37427

Closed
annezazu opened this issue Dec 15, 2021 · 2 comments · Fixed by #37442
Closed

Template Editor toolbar dropdown broken #37427

annezazu opened this issue Dec 15, 2021 · 2 comments · Fixed by #37442
Assignees
Labels
[Feature] Template Editing Mode Related to the template editor available in the Block Editor [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@annezazu
Copy link
Contributor

Description

When editing a template via the template editing mode in the post editor, the dropdown in the toolbar appears to be broken.

Step-by-step reproduction instructions

  1. Use a block theme or theme supporting template editing mode
  2. Head to a post or page
  3. Under Templates in sidebar > Edit
  4. Try to click the dropdown in the toolbar.

Screenshots, screen recording, code snippet

drop.down.template.editor.mov

Screen Shot 2021-12-15 at 6 06 43 PM

Screen Shot 2021-12-15 at 6 07 57 PM

Environment info

  • WordPress 5.9 beta 3
  • No GB
  • TT2

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

@annezazu annezazu added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Feature] Template Editing Mode Related to the template editor available in the Block Editor labels Dec 15, 2021
@glendaviesnz
Copy link
Contributor

It looks like part of the issue here is that if a template has a template file then the drop down is supposed to display the template description:

Screen Shot 2021-12-16 at 3 59 48 PM

... but some templates don't have a description:

Screen Shot 2021-12-16 at 4 00 35 PM

There seem to be two ways that we could fix this if template.has_theme_file && template.description === '':

  1. Just display the template title with no dropdown
  2. Display the dropdown with a generic fallback message

Option 1. seems like a good option as there doesn't seem to be any need to show the dropdown if no description, but I haven't worked on this area at all so there may be something I am overlooking.

@Mamaduka
Copy link
Member

I think I know the reason for the regression. I will push the fix for the issue shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Template Editing Mode Related to the template editor available in the Block Editor [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants