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

Site Editor: Template part is missing after exiting focus mode #36937

Closed
Mamaduka opened this issue Nov 28, 2021 · 9 comments · Fixed by #37283
Closed

Site Editor: Template part is missing after exiting focus mode #36937

Mamaduka opened this issue Nov 28, 2021 · 9 comments · Fixed by #37283
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Technical Feedback Needs testing from a developer perspective. [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@Mamaduka
Copy link
Member

Mamaduka commented Nov 28, 2021

When switching into focus mode to edit the template part, it's missing after going back to the template using the "Back" button.

Step-by-step reproduction instructions

  1. Go to Appearance > Editor
  2. Open templates details dropdown in the header.
  3. Click on "More Options" for the area and "Edit {templatePartName}
  4. Without doing anything, click the "Back" button.
  5. See that now the template part you were editing is missing from the page.

Screenshot

CleanShot.2021-11-28.at.23.55.06.mp4

I tested with TT1 Blocks and TT2 themes.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 28, 2021
@Mamaduka
Copy link
Member Author

@kevin940726, I remember you worked on this feature. Any ideas why this might be happening?

@kevin940726
Copy link
Member

I did the bisecting and found the first bad commit is coming from #36340. I have no idea why though. The problem goes away if I commented out this part:

5458edc#diff-884dae78f1676d454c049107e9b05b2403eb042457f77f836bd170d104396b8bR226-R233

Maybe @tellthemachines knows why?

@Mamaduka
Copy link
Member Author

Thanks for the follow-up, @kevin940726.

@tellthemachines
Copy link
Contributor

The problem goes away if I commented out this part:
5458edc#diff-884dae78f1676d454c049107e9b05b2403eb042457f77f836bd170d104396b8bR226-R233

No idea, but that code's specific to the navigation block. Does this issue happen with any template part or only one that contains a navigation?

@tellthemachines
Copy link
Contributor

Answering my own question above 😅, I can reproduce this on latest trunk with any template part, whatever it contains. I'm also seeing a few PHP notices when loading the editor, not sure if they may be related:

Notice: Undefined property: WP_Block_Template::$origin in /var/www/html/wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/class-gutenberg-rest-templates-controller.php on line 467

Notice: Undefined property: WP_Block_Template::$author in /var/www/html/wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/class-gutenberg-rest-templates-controller.php on line 477

@Mamaduka
Copy link
Member Author

Thanks for looking at the problem, @tellthemachines.

The PHP notices should be fixed now, but I don't think those are the cause.

@noisysocks
Copy link
Member

noisysocks commented Dec 2, 2021

The symptoms here look suspiciously like the ones in #36788. Could be related.

@noisysocks noisysocks added the [Priority] High Used to indicate top priority items that need quick attention label Dec 8, 2021
@Mamaduka
Copy link
Member Author

Hi folks, I tried to debug this issue but failed 😞

Here are my findings so far:

  • Started happening in Gutenberg 12.0
  • The template part block's Edit component is rendered, but inner blocks aren't.
  • We've all props required to render inner blocks, but they refuse to do so.
  • When testing with TT2, I remove Site Logo and Navigation blocks from the header. Go back works as expected.

@noisysocks noisysocks added the Needs Technical Feedback Needs testing from a developer perspective. label Dec 10, 2021
@noisysocks
Copy link
Member

Pinging @WordPress/gutenberg-core for technical feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Technical Feedback Needs testing from a developer perspective. [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants