new changes to stream field content is lost if a validation error occurred while saving
AsankaL opened this issue · comments
I've created a custom ImageGalleryBlock and ImageGalleryItemBlock as follow.
class ImageGalleryBlock(StructBlock):
image_list = ListBlock(ImageGalleryItemBlock(), label="Image Gallery")
title = CharBlock(label="Gallery Title")
class ImageGalleryItemBlock(StructBlock):
image = ImageChooserBlock()
caption = CharBlock(required=False)
When I try to save and there is validation error in the one of these blocks, react-streamfield crashes.(e.g: trying to save without 'title' for ImageGalleryBlock)
It shows Uncaught TypeError: Cannot read property 'split' of null
in console.
I can confirm it, introduced recently by wagtail-deprecated/react-streamfield@d76a986 & wagtail-deprecated/react-streamfield@0ee27e0. I’m working on a fix.
Fixed by wagtail-deprecated/react-streamfield@9adafc9 and released in 1.1.1.