Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

FieldBlock created for MultiValueField instance throws javascript error. #43

@jonathanpglick

Description

@jonathanpglick

I'm creating a StructBlock with a Django SplitDateTimeField form field like this:

class EventBlock(blocks.StructBlock):
    title = blocks.CharBlock()
    text = blocks.TextBlock()
    datetime = SplitDateTimeBlock()

So I implemented the SplitDateTimeBlock() to wrap the SplitDateTimeField like this:

class SplitDateTimeBlock(FieldBlock):
    def __init__(self, *args, **kwargs):
        self.field = SplitDateTimeField(*args, **kwargs)
        super().__init__(*args, **kwargs)

But SplitDateTimeField extends from MultiValueField and it seems to be causing an error. When I click to add the EventBlock I get a javascript error (below) and the page goes blank.

image

Do you know why this is happening? Is there a way to get wagtail react streamfield to support FieldBlocks based on MultiValueField form fields?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions