wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)
https://wagtail.github.io/react-streamfield/public/
BSD 3-Clause "New" or "Revised" License
74 stars 23 forks source link

ImageChooserPanel not rendered correctly #47

Closed mwesterhof closed 5 years ago

mwesterhof commented 5 years ago

When using the latest version of wagtail-react-streamfield (1.3.4), i'm running into the following problem:

I created a custom StructBlock, containing an ImageChooserBlock. This StructBlock is made available in a page's StreamField.

After adding a block and choosing an image, everything seems fine (the image is rendered in the streamfield panel just as expected). The page saves fine, and the content is ok as well. However, when I edit a page that already contains the block with filled-in image, the image isn't rendered in the panel. The content is fine, and when I remove "wagtail_react_streamfield" from the INSTALLED_APPS, the image does become visible in the admin.

I set up a minimal example of this behavior here

TL;DR: when viewing existing content in the admin, imagechooserblocks aren't rendered correctly

mwesterhof commented 5 years ago

As it turns out, it was my mistake, all along. The documentation specifically states that the "wagtail_react_streamfield" app should be added to INSTALLED_APPS before 'wagtail.admin', 'wagtail.images', 'wagtail.docs' & 'wagtail.snippets'. Making that change resolved the issue

lohmander commented 5 years ago

Hmm, I have the same issue, but I do have the the app first. So I don't think it's only the app order that matters. No choosers work, all show up without any initial value.

Perhaps it'd be worthwhile reopening this?

pimarc commented 4 years ago

Same issue. Resolved by changing the order of Apps:

Not working:

'home',
'search',
'whello',

'wagtail_react_streamfield',

'wagtail.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail.core',
'wagtail.contrib.modeladmin',
'wagtailmenus',
'wagtailfontawesome',

Working

'home',
'search',
'whello',

'wagtail.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail_react_streamfield',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail.core',
'wagtail.contrib.modeladmin',
'wagtailmenus',
'wagtailfontawesome',