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

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

Closed
twerq opened this issue Nov 26, 2017 · 11 comments · Fixed by #8259
Closed

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

twerq opened this issue Nov 26, 2017 · 11 comments · Fixed by #8259
Assignees
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Design Needs design efforts. [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@twerq
Copy link

twerq commented Nov 26, 2017

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.

@danielbachhuber
Copy link
Member

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".

@danielbachhuber danielbachhuber added the [Status] Needs More Info Follow-up required in order to be actionable. label Jan 19, 2018
@danielbachhuber
Copy link
Member

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.

@danielbachhuber danielbachhuber added [Type] Bug An existing feature does not function as intended [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Jan 19, 2018
@danielbachhuber danielbachhuber changed the title Clicking edit blog page suggest to write story for it Gutenberg doesn't respect "Posts page" functionality in Twenty Seventeen Jan 19, 2018
@danielbachhuber danielbachhuber changed the title Gutenberg doesn't respect "Posts page" functionality in Twenty Seventeen Gutenberg doesn't respect "Posts page" behavior (hiding editor) in Twenty Seventeen Jan 19, 2018
@twerq
Copy link
Author

twerq commented Jan 21, 2018

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

@danielbachhuber danielbachhuber added the Backwards Compatibility Issues or PRs that impact backwards compatability label Jan 22, 2018
@danielbachhuber
Copy link
Member

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

image

@karmatosed karmatosed added this to the Merge Proposal milestone Jan 25, 2018
@jeffpaul
Copy link
Member

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

@karmatosed karmatosed modified the milestones: Merge Proposal, Merge Proposal: Back Compat Apr 12, 2018
@mtias mtias added [Type] Task Issues or PRs that have been broken down into an individual action to take and removed [Type] Bug An existing feature does not function as intended labels May 8, 2018
@gziolo gziolo added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Jun 11, 2018
@wpscholar
Copy link
Member

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.

@aduth
Copy link
Member

aduth commented Jul 30, 2018

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

@aduth aduth added Needs Design Needs design efforts. and removed [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. labels Jul 30, 2018
@aduth
Copy link
Member

aduth commented Jul 30, 2018

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.

@wpscholar
Copy link
Member

@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.

@aduth
Copy link
Member

aduth commented Jul 30, 2018

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).

@wpscholar
Copy link
Member

@aduth Good point. I've created a new issue here: #8321

@wpscholar wpscholar self-assigned this Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Design Needs design efforts. [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants