-
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
Editor freezes when current user role doesn't have 'edit_posts' capability #27854
Comments
Discovered this issue while trying to set up a new site, glad someone else noticed this, too. Perhaps worth noting even without any custom post types, even if you simply try to edit the built-in page type and you do not have the edit_posts capability, it will still freeze in this scenario. |
We cannot reproduce this specifically on our end, but we run a site with about 150 writers, and several of them have reported issues similar to this. We use custom post types, and none of our authors have edit_posts capabilities. It's difficult to say because we cannot repro even when logged in as them, but if there's any data we can provide (as filtered through technically proficient but not developer-quality users), please let me know and we'll ask them for data when it freezes. |
I have noticed the same problem as well, and I seem able to reliably replicate the behaviour on a clean WordPress install using customisations in a child theme of TwentyTwenty theme. I've also noticed if I install the classic editor plugin and disable Gutenberg the editing page loads as it should, so it does appear to be Gutenberg causing the problem. I'm creating a custom post type and a custom role, then assigning the CPT custom capabilities to the new role. Custom post type registration code
Custom role creation and addition of capabilities
|
I haven't confirmed this but adding to 5.7 board as it sounds potentially impactful. |
This was also reported at #28071 and I was able to reproduce the bug using the test case that's provided at that issue but I can only reproduce when using the version of gutenberg that is included with 5.6..; I cannot reproduce with the gutenberg plugin (9.7.0) activated. @metalandcoffee and @mateusmeyer : Are you still experiencing this issue when you install and activate the gutenberg plugin at https://wordpress.org/plugins/gutenberg/ |
@skorasaurus It's working without freezing after activating Gutenberg plugin. |
Hi @skorasaurus 👋🏾 I have also confirmed that the issue is resolved when activating the Gutenberg plugin. I wonder what specific code update resolved this issue. |
I did some troubleshooting; the fix was introduced into Gutenberg sometime between Gutenberg 9.3.0 and 9.4.0. ; if someone else wants to find the specific commit so it could get backported into a 5.6.x release, they can go ahead. |
I can also confirm this. Since switching to Gutenberg isn't any easy path to take due to multiple other changes that this would introduce I think this urgently needs to go into 5.6.1. |
Hi, I've also seen this and have done a bit of digging based on the hint in #27854 (comment). I'm not familiar with the Gutenberg codebase at all so I just used As a test I've hacked the Hopefully the commit can just be cherry picked but I don't know how all the various versions of Gutenberg fit with WP releases. So in terms of getting this into a release I'm not sure what the next steps are but hopefully someone else does :) |
Thanks @wpf500 This will definitely be a part of WordPress 5.7 (to be released on March 9th) which will have everything from Gutenberg through 9.9. I don't know if there will be another WordPress 5.6.* release. |
I've labelled #26447 with the 'Backport to Minor Release' label, so that if there is a 5.6.2 it'll be included. |
There are plans for a 5.6.2 release. |
Removing this from the 5.7 project board, as the fix (#26447) is already included in 5.7. |
I can confirm that 5.6.2 fixed this 🥳 |
Thanks, please reopen if you're still experiencing this in 5.6.2 or a newer version :) |
Describe the bug
When using a user with a role that has 'edit_posts' capability disabled, Gutenberg freezes. It's a Javascript infinite loop somewhere in Gutenberg, as page freezes completely.
To reproduce
Steps to reproduce the behavior:
edit_posts
capability` and assign a user on it. Example of role:Expected behavior
Gutenberg editor should work flawlessly, without freezes.
Screenshots
https://user-images.githubusercontent.com/18129145/102828786-52fe9880-43c4-11eb-826f-ac5c339918b3.mp4 (indeed a JS freeze)
Editor version:
Desktop:
Smartphone:
The text was updated successfully, but these errors were encountered: