-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix: use old template panel if user doesn’t have access to view templates #58485
Conversation
Size Change: +35 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in be606db. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7722574789
|
28c78c5
to
be606db
Compare
@fabiankaegy, which bundled theme are you using for testing? |
@Mamaduka I'm using 2024 (a block theme but logged in as a user with a role lower than admin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@draganescu Yes and no, even if this check were to check for See #58301 for more details on the actual long term fix I would like to land instead of this "hotfix" here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @fabiankaegy!
The changes test well for me, and I think it is a cute short-term fix.
Like you said a better solution would be introducing proper capabilities for templates and utilizing them in the editors.
What?
Make it possible for non administrators to switch between templates again.
Closing: #58037
This fix is an alternative approach to #58301. #58301 tries to solve it whilst still retaining the ability for editors to preview the template in the editor where as this PR here only restores the old behavior.
I personally would very much preffer #58301 since I think the template preview is a very valuable feature that editors should have access to. But as far as 6.5 goes this here may be the stop gap solution we need.
Why?
Because a regression was introduced in #56817
How?
By checking if the current user can view the templates post type and if not rendering the classic control.
Testing Instructions