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 Part: Only display a missing notice in debug mode #37404

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

Mamaduka
Copy link
Member

Description

Resolves #37222.

The "Template part not found" message was displayed for logged-in users. PR update condition to only show message when in debug mode.

It matches the condition for infinity recussion message.

P.S. Template Part block will still display the missing state in Site Editor.

How has this been tested?

  1. Set WP_DEBUG and WP_DEBUG_DISPLAY to true.
  2. In block theme temporarily rename the template-parts directory.
  3. Check that the site displays messages.
  4. Disable debug mode.
  5. The site shouldn't display messages.

Types of changes

Bugfix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@Mamaduka Mamaduka requested a review from ajitbohra as a code owner December 15, 2021 11:45
@Mamaduka Mamaduka self-assigned this Dec 15, 2021
@Mamaduka Mamaduka added [Block] Template Part Affects the Template Parts Block [Type] Bug An existing feature does not function as intended labels Dec 15, 2021
Copy link
Contributor

@kjellr kjellr left a comment

Choose a reason for hiding this comment

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

This works in my testing! Thanks, @Mamaduka!

@talldan
Copy link
Contributor

talldan commented Dec 16, 2021

Ah, so it was only displaying for logged in users, which isn't too bad. But I think only in debug mode makes even more sense. Thanks @Mamaduka!

@talldan talldan merged commit d0fa111 into trunk Dec 16, 2021
@talldan talldan deleted the fix/hide-template-part-not-found branch December 16, 2021 03:10
@github-actions github-actions bot added this to the Gutenberg 12.3 milestone Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve treatment of the "Template Part Not Found" message
3 participants