Gutenberg: Gutenberg doesn't respect "Posts page" behavior (hiding editor) in Twenty Seventeen

Created on 26 Nov 2017  Â·  11Comments  Â·  Source: WordPress/gutenberg

Issue Overview

Using twentyseventeen theme In static front page mode. Front page with panels: main page, page, one more page and blog page. Clicking edit link under blog page title allows to add story into it o_O

Steps to Reproduce (for bugs)

  1. ensure you are using twentyseventeen theme
  2. switch to static page mode for main page
  3. add some pages to the panels
  4. add blog page to one of the panels
  5. hit home page
  6. scroll to panel with blog page
  7. hit edit
  8. add some story in blog page

Google Chromium 62.0.3202.94 (Official Build) Built on Ubuntu , running on LinuxMint 18.2 (64-bit)

Expected Behavior

Expected editable title for blog page and editable permalink only like it done in core editor.

Current Behavior

Currently I can add a story for the blog page which should not have any story itself.

Possible Solution

Need handle for special pages like blog page or such.

Backwards Compatibility Good First Issue Needs Design [Type] Task

Most helpful comment

I came across the underlying logic in wp-admin/edit-form-advanced.php today:

image

All 11 comments

Thanks for the report @infodiver.

Expected editable title for blog page and editable permalink only like it done in core editor.

Can you clarify what you mean by this? When I get to step 7, this is what I see:

image

I'm not sure what you mean by step 8 — "add some story in the blog page".

Oh, I think I know what you mean. When I open the "Blog" page in the classic editor, this is what I see:

image

Either Gutenberg or Twenty Seventeen should respect this existing behavior. I don't immediately know where the responsibility lies though.

Also have tested against Twenty Fifteen theme with the same result.

I came across the underlying logic in wp-admin/edit-form-advanced.php today:

image

_This ticket was mentioned in Slack in #core-editor by jeffpaul. View the logs._

Pull request #8259 resolves this issue by adding a check for the posts page to the gutenberg_can_edit_post() function as follows:

gutenberg____sites_localsites_gutenberg_app_public__-_____wp-content_plugins_gutenberg_lib_register_php__gutenberg_

While this solves the issue, it does appear that there is a separate issue where all screen options are enabled anytime Gutenberg would have loaded but was prevented by this code.

Is this really something where we should be falling back to classic editor? Could we present the equivalent information in a Gutenberg context instead?

I don't think this is theme-specific. I've removed the associated interoperability label. Let me know if I'm wrong and it can be re-added.

@aduth We aren't really falling back to the classic editor... we are disabling the editor completely. Assuming someone is trying to edit the blog posts page and has content, they will be able to edit it in Gutenberg. However, if they have no content, the editor will be disabled completely, as it currently is in WordPress core.

Yes, but: Gutenberg is not just the content editor. Likening it to TinyMCE, in Classic editor when the editor is disabled, we simply don't initialize TinyMCE. In Gutenberg, we can do the same by displaying all of the chrome, but not initializing the Editor component.

That being said, apparently when a post type doesn't support 'editor', we fall back to the Classic editor. I don't think we should be doing this, but I imagine it was done this way as a point of convenience.

I'd be fine to do the same for posts page, but also think we should create a new separate issue to have better handling for the disabled editor (if one doesn't already exist).

@aduth Good point. I've created a new issue here: https://github.com/WordPress/gutenberg/issues/8321

Was this page helpful?
0 / 5 - 0 ratings