Skip Navigation

Resolved

Reported for: WPML Media Translation 2.6.0

Overview of the issue

If you use the Gutenberg Block Editor and manually translate a page that contains an image or a gallery block, you will get an error: “This block contains unexpected or invalid content.”

Workaround

Clicking on the Resolve button fixes the issue.

2 Responses to “"This block contains unexpected or invalid content" for Gutenberg images when using manual translation”

  1. Clicking on Resolve does not fix the issue. It persist every time you return to the page or if it refreshed (e.g. after a save).

    May I add that this error also happens at the Media-Text block. The error is caused by a mismatch in the block validation. The inline img tag from these blocks all have a class added to them, that mismatches with the class on the front-end.

    E.g.

    Content generated by `save` function:

    Content retrieved from post body:

    This issue was also mentioned here; https://wpml.org/forums/topic/upon-updating-wpml-gutenberg-attempt-block-recovery/
    The workaround mentioned is not desired, and a lot of work if you (for example) have image-heavy website that you want to translate quickly page for page.