JavaScript for WordPress › Forums › Bugs & Issues › Broken gallery block – Advanced Gutenberg Course › Reply To: Broken gallery block – Advanced Gutenberg Course
February 18, 2019 at 10:10 am
#90559
ldecoker
Participant
Hello!
The errors I’ve got came from this code (from github):
const onSelectImages = newImages => {
const images = newImages.map(img =>
Object.assign(
{},
{
src: img.sizes.large.url,
width: img.sizes.large.width,
height: img.sizes.large.height,
id: img.sizes.large.id,
alt: img.sizes.large.alt,
caption: img.sizes.large.caption
}
)
);
setAttributes({ images });
};
First I had to change large by full and then for the id/alt/caption field, you need to remove the sizes.large part.
Have a nice day!