Archived topic
Heading blocks with icons breaks when users with lower permissions added
8 replies · Started by Charmony on September 7, 2021
Hey there - I've recently added a user with Contributor permissions to manage my site. I also use heading blocks with icons for styling purposes. The problem occurs whenever I (Admin) uses this block type with icons and hands over these posts to the Contributor for editing. Soon as the Contributor starts editing the post, those block types won't render and parses "This block contains unexpected or invalid content" message. This also happens vice-versa when Contributor uses icons and the Admin edits said post.
Testing around I discovered a few things that may or may not help hone in the issue:
- Happens with icons only so maybe an issue with svgs
- svg element is stripped when page html is viewed using the browser's dev console
- When I upgraded the user's permission to Editor, the problem goes away. Seems to be prevalent with Contributor and Author permissions
Might be an edge case but hoping you can help since we'll be onboarding new users.
Thanks!
Understand that you guys might be busy but want to make sure this is not dropped. I've seen newer tickets being worked on or resolved. We have a new user to onboard so appreciate the urgency.
Thanks.
Hi there,
Your topic slipped away from our support system, I'm very sorry for the late reply.
It doesn't sound like a theme issue, does it happen when you activate Twenty Twenty one theme as well?
And when you say heading block, do you mean the WP heading block or the headline block from GenerateBlocks?
Let me know :)
Hey Ying - Thanks for your response. It's the GP Headline block.
Hi there,
i can replicate the issue. I looks like WP is stripping the inline SVG for users with lesser privileges. I am not sure if that is something GB controls or WP. I am going to pass it to Tom to take a look.
Thanks David. For what it's worth, inline svg is stripped for users with higher permissions too. Seems to happen whenever the post is passed between certain permission clusters (e.g. Admin to Editor is fine. Admin to Contributor or Author is not) etc.
Hi there,
The author/contributor roles don't have permission in WP to save things like SVG code.
However, you can override this: https://docs.generateblocks.com/article/fix-svg-icons-not-saving/
More info here: https://mkaz.blog/wordpress/allowing-svg-in-wordpress-content/
Let us know if you have any other questions :)
Thanks team! Worked like a charm.
Glad we could help :)