Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Front Page template with static homepage breaks the template editor #81928

Closed tanjoymor closed 1 year ago

tanjoymor commented 1 year ago

Quick summary

When a theme comes with the Front Page template (StartFit, Exmoor) and you assign a static homepage, the Site Editor template breaks in that you can't select or edit the blocks added in the template.

This is a problem because assigning a static homepage is the only way for a Simple site to be able to assign a Featured Image or control a custom excerpt for the Homepage for SEO and social sharing purposes.

https://github.com/Automattic/wp-calypso/assets/42655541/c700ed37-194f-4fee-96df-2c0f55ff7c09

Steps to reproduce

  1. Activate a theme that uses Front Page (StartFit or Exmoor for example)
  2. Assign a static (custom) homepage under Settings > Reading
  3. Go to Appearance > Editor
  4. Edit the homepage (click in the preview area)
  5. Switch to Edit Template
  6. Open List View (blocks are missing)
  7. Try to select or edit any content in the editor window (you can't)
  8. Switch the Reading Settings back to "Default" (or Display latest posts) and the Site Editor will work normally

What you expected to happen

I expected the template editor to work as normal when a static (custom) homepage is assigned.

What actually happened

Most blocks within the Front Page template in the Site Editor are missing from the List View and you can't select any of the content or edit it.

Impact

All

Available workarounds?

No and the platform is unusable

Platform (Simple and/or Atomic)

Simple, Atomic

Logs or notes

My screen recording is with an Atomic Staging Site, I've confirmed the behavior in a regular Atomic site and a Simple site. I haven't tested in a self-hosted site.

cuemarie commented 1 year ago

📌 REPRODUCTION RESULTS

📌 FINDINGS/SCREENSHOTS/VIDEO Ran a quick test on Exmoor on Simple and could not replicate - the Front Page template was editable even with a static homepage set as the homepage under Settings > Reading.

📌 ACTIONS

📌 Message to Author @tanjoymor KitKat is on our meetup this week, so I'm not able to thoroughly triage this at the moment. Might be helpful to drop this in the PA channel to ask others to try to reproduce, in the meantime!

fushar commented 1 year ago

FYI, I can reproduce this issue with the exact same steps as @tanjoymor mentioned in the issue description. (I used Exmoor theme.)

cuemarie commented 1 year ago

Thanks @fushar ! Glad to see Lego is looking into this as well.

📌 REPRODUCTION RESULTS

📌 FINDINGS/SCREENSHOTS/VIDEO With theme Exmoor, I could reproduce this on Atomic and self-hosted, but not Simple. See examples below:

Simple

https://github.com/Automattic/wp-calypso/assets/27249804/e82bcfeb-7c0a-4b0a-ad02-dca1ca24a34b

Atomic

https://github.com/Automattic/wp-calypso/assets/27249804/632e6526-fbba-4c8d-b8a1-6424780db551

Self-Hosted with exmoor-wpcom-1.0.4 active

Markup on 2023-09-26 at 10:59:56

📌 ACTIONS

happychait commented 1 year ago

I encountered this while troubleshooting a user report in 7094522-zen

github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.

tanjoymor commented 1 year ago

An additional issue has been discovered on this with regards to the Posts Page setting too.

  1. If you assign a posts page with the Default homepage in the Calypso Reading Settings, the Posts Page setting is ignored.
  2. If you assign a posts page with a custom (static) homepage in either Calypso or wp-admin Reading Settings, the Posts Page works, the Front Page blocks are not editable.
  3. If you use the wp-admin Reading Settings and leave the homepage "unset" and assign the Posts Page, then the site will set that Posts Page to be the Homepage of the site thus ignoring the presence of the Front Page template, though the Front Page template blocks can be edited.

I'll try to grab a recording of this situation when I have more time.

fushar commented 1 year ago

I tested again using the latest Gutenberg v16.7.0 (by adding gutenberg-edge blog sticker) and I can't repro the issue anymore.

However, clicking "Edit Template" opens up the Pages template now, not the Front Page template. (Not sure if this is expected?)

Can anyone else also test on Gutenberg v16.7.* ?

arthur791004 commented 1 year ago

Tested it via the JN site with the Gutenberg v16.7.0, and it seems to work as expected when I tried to edit the Front Page template.

image

But it's weird that I cannot see the Edit Template on the Site Editor. Instead, I have to go to the page template, and then click Edit Template there to open the Front Page template on the Site Editor 😂

fushar commented 1 year ago

But it's weird that I cannot see the Edit Template on the Site Editor. Instead, I have to go to the page template, and then click Edit Template there to open the Front Page template on the Site Editor

In my testing, I was able to do that by clicking on the Content block; then a notification will appear at the bottom-left corner:

image

But, as I mentioned above, it will somehow open up the Pages template, not Front Page:

image

What's your experience @arthur791004 , could you describe?

arthur791004 commented 1 year ago

In my testing, I was able to do that by clicking on the Content block; then a notification will appear at the bottom-left corner:

Sometimes I can see the notification but sometimes I cannot 😞

But, as I mentioned above, it will somehow open up the Pages template, not Front Page:

Yes, I also saw the Pages template on the block settings of the Sidebar in the Site Editor. However, it showed the Front Page template in the Page Editor...

Here is my demo. I spent some time to find how to trigger the notification to edit the Pages template but it never showed 😅

https://github.com/Automattic/wp-calypso/assets/13596067/5beb5071-df00-489d-bd09-86762fc98b21

tanjoymor commented 1 year ago

I've created a recording, using a Pressable (self-hosted) site to demonstrate all the oddities happening with themes that use the Front Page template. The behavior of these themes has changed from the way they used to work, I'm not sure what the change/cause might be or when exactly it happened.

The only anchor in timing that I have is that it was working as expected on August 4th. So it seems to have been a change that took place some time between August 4th and September 19th, which could possibly be further narrowed down by trimming another week off of those two dates, because it was working for a while after August 4th and I noticed the issue a bit prior to creating this GH issue. So maybe something between August 10th and September 7th - ish. At least as a start point for investigating.

This recording first goes through the settings and situations without the GB plugin (up to the 8:15 timestamp) and then goes through the steps with GB 16.7 active through to the end of the recording. And I explain my way through the recording.

https://github.com/Automattic/wp-calypso/assets/42655541/87735616-1dfa-4e0a-93a1-f7df6783aa3e

autumnfjeld commented 1 year ago

@tanjoymor This should have been fixed in the latest GB version. Could you check? @Automattic/lego will also check.

tanjoymor commented 1 year ago

@autumnfjeld I guess that depends on how we're defining "fixed". At the moment, themes with the Front Page template are now behaving completely different to how they have always behaved, but the blocks do seem to be working in terms of being able to edit things again.

So if the goal was to make the Front Page template no longer be the aggressive template it used to be, and to have it no longer override the Homepage settings, yes that appears to be the case, which is going to require a mental shift and updates to several materials to explain that it works differently now.

After some quick testing, it seems that the Front Page template is now behaving the same way as either the Blog Home or Index template. Which I'll be honest, based on past conversations, I didn't even think was possible.

This also means that now, there is no way to assign a featured image or custom excerpt to the Homepage of a site that is using the default template for the Homepage on a Dotcom Simple site, and the only way to do it on an Atomic or self-hosted site is with a plugin. (This undoes the discoveries that @fushar and I had made regarding this point and the ability to use the Front Page template connected to a regular page as a work around.)

fushar commented 1 year ago

After some quick testing, it seems that the Front Page template is now behaving the same way as either the Blog Home or Index template.

Are you sure? I just tested with the following steps and the template hierarchy seems to be respected:

  1. Activate Kigen (theme with Front Page template)
  2. Change Reading Settings to display homepage with a static page (I used the default About page)
  3. Open the site frontpage
  4. I see the front page template, not the About page
fushar commented 1 year ago

This also means that now, there is no way to assign a featured image or custom excerpt to the Homepage of a site that is using the default template for the Homepage on a Dotcom Simple site

I just tested assigning a featured image on the static home page, and it shows up on social media when we share the site URL:

image
fushar commented 1 year ago

But one thing is still broken here. When I open the Site Editor, it will open the static page (wrong) instead of the Front Page template (expected). Even worse, clicking the Edit template link will then open the wrong Pages template.

This does not happen in Core (I tested a Jurassic Ninja site).

fushar commented 1 year ago

@tanjoymor I opened a new issue instead: https://github.com/Automattic/wp-calypso/issues/82910

Could you confirm that we can close this issue as the original issue that you reported is resolved? 🙏

tanjoymor commented 1 year ago

But one thing is still broken here. When I open the Site Editor, it will open the static page (wrong) instead of the Front Page template (expected). Even worse, clicking the Edit template link will then open the wrong Pages template.

This does not happen in Core (I tested a Jurassic Ninja site).

This ^ I just came back here to say I've done more testing and found the same situation as you. So yes, the original issue of this GH seems fixed and can be closed. I guess we'll see if that's still the case when the new issue is fixed.