wagtailmodelchoosers icon indicating copy to clipboard operation
wagtailmodelchoosers copied to clipboard

ModelChooserBlock label needs to be passed down Block init

Open mojeto opened this issue 5 years ago • 0 comments

Setting explicit label on any RemoteModelChooserBlock doesn't work, because the value ends up on https://github.com/springload/wagtailmodelchoosers/blob/39e32d43295ace6d5c9802f88a58ddad84acff8b/wagtailmodelchoosers/blocks.py#L20

but self.label gets overwritten in parent Block.init

Also it's mandatory for label to be set on self.meta.label as well for Wagtail block to work properly. Otherwise label value gets overwritten in https://github.com/wagtail/wagtail/blob/7c3418f99e7b2c2da7ad19b2840d73099dadc6a7/wagtail/core/blocks/base.py#L104

mojeto avatar Aug 14 '19 03:08 mojeto