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

Editing "Page" is broken for low capability users #68053

Closed
Mamaduka opened this issue Dec 17, 2024 · 4 comments · Fixed by #68110
Closed

Editing "Page" is broken for low capability users #68053

Mamaduka opened this issue Dec 17, 2024 · 4 comments · Fixed by #68110
Assignees
Labels
[Feature] Template Editing Mode Related to the template editor available in the Block Editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@Mamaduka
Copy link
Member

Nothing is rendered in the editor canvas when editing pages using a non-administrator user (Editor). The bug doesn't affect WP 6.7. I think this is a regression since #62304.

Testing Instructions

  1. Create a test user with an Editor role.
  2. Switch to this user. You can use the User Switching plugin.
  3. Open a page.
  4. Confirm that the editor canvas is blank.

Screenshot

Image

@Mamaduka Mamaduka added [Feature] Template Editing Mode Related to the template editor available in the Block Editor [Type] Bug An existing feature does not function as intended labels Dec 17, 2024
@Marc-pi
Copy link

Marc-pi commented Dec 18, 2024

confirmed there also

Description

Since 19.8, the Editor role gets a blank page only on Page when editing it (it's ok on story)
I tested on 19.9 also, the issue is the same

The solution is to deactivate the gutenberg plugin, to bring back the editing capability to users with the Editor role.

Step-by-step reproduction instructions

  1. Go to a Page, with a profile that has the Editor capability
  2. Edit it
  3. the page opens, but with blank content
  4. no message in the dev tool (FF or Chrome)

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.7.1
Gutenberg 19.8 / 19.9
TT4 theme

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

@vipul0425
Copy link
Contributor

Hi @Marc-pi, for now, instead of deactivating Gutenberg, you can add the following code to the functions.php file in your theme:

add_filter(
	'post_type_page_default_rendering_mode',
	function () {
		return 'post-only';
	}
);

It will make the content visible for users with editor role.

The issue here is we are not getting any templates in non-admin roles (which seems to be a regression issue ) and in this #62304 we have set the default rendering mode to template-only for pages.

@Marc-pi
Copy link

Marc-pi commented Dec 18, 2024

yep, i was just reading #62304 to understand what was done, and was about to undertstand i can fix with a filter ;-)
seems there was some discussion recently on it !
thanks for the turnaround !

@Mamaduka
Copy link
Member Author

I would recommend using the register_post_type_args filter to hotfix the issue. The new filters probably will be removed in #67867.

add_filter( 'register_post_type_args', function( $args ) {
	unset( $args['default_rendering_mode'] );
	return $args;
}, 20 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Template Editing Mode Related to the template editor available in the Block Editor [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.

4 participants