Overview of the Issue
If you create a Gutenberg Gallery with the Jetpack plugin, you will see this error on the translation:
Warning: Invalid argument supplied for foreach() in …/wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.php on line 738
Workaround
This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.
- Make a full backup of your site.
- Open the wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.php file.
- Look for line 786.
- Change:
$attachment_id = absint( $class_id[2] );
- With
$attachment_id = apply_filters( 'wpml_object_id', absint( $class_id[2] ), 'attachment' );