unexpected or invalid content with dynamic links

  • Hi,

    I found topics with the same error message, but none like this: Whereever I use dynamic links (mostly permalinks, but also for images etc.) it works fine for admin users. But if any non-admin user saves a page that uses a block with a dynamic link, that block breaks with this message: “Block contains unexpected or invalid content.”

    The console shows these errors when saving:

    blocks.min.js?ver=84530c06a3c62815b497:19 Block validation: Block validation failed for generateblocks/text ({name: ‘generateblocks/text’, icon: {…}, keywords: Array(4), attributes: {…}, providesContext: {…}, …}).
    Content generated by save function:
    TEST
    Content retrieved from post body:
    TEST

    I have tried deactivating all plugins, except Generatepress and -Blocks. Same. No problem with static links.

    Would you have an idea?

    Thanks!

  • Hi there,

    This could be related to user capability permissions. What is the role or capability level of the non-admin user? If the user has the Editor role, there should typically be no issue with saving changes.

  • Hi Alvin,

    Thanks. Since I don’t change anything with these blocks before saving, why to they change and break, regardless of capabilities?
    This is a custom role I created and set capabilities for.
    What capabilities are needed to avoid the error?

  • Since I don’t change anything with these blocks before saving, why to they change and break, regardless of capabilities?

    Check that block to see if it includes any SVG icons—that could be the reason for the issue. Due to security restrictions, only users with Administrator or Editor roles are allowed to save blocks containing SVG content.

    Try giving the custom role the edit_posts capability. That should allow them to save the block correctly.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.