Closed jhnbkr closed 2 years ago
hey @jhnbkr I am afraid I cannot replicate this neither with bakerydemo, nor running tox -e interactive
with tox.ini
's interactive
target updated to interactive: wagtail>=3.0,<4.0
I should add this specifically happens when using either AudioChooserBlock
or VideoChooserBlock
in a StreamField.
Apologies, this information may be pertinent.
I have been able to isolate a potential issue.
By default our project uses STATICFILES_STORAGE=storages.backends.gcloud.GoogleCloudStorage
(via django-storages).
If I configure STATICFILES_STORAGE=django.contrib.staticfiles.storage.StaticFilesStorage
the issue is resolved. However, we cannot use this in production.
initWMTabs
is defined in wagtailmedia/js/tabs.js which appears to be retrieved asynchronously when the chooser modal is invoked. I can see in my network requests tags.js
being retrieved. At the same time wagtailmedia/js/media-chooser-modal.js attempts to invoke initWMTabs
, which is not yet available.
If you close and reopen the modal the issue resolves itself.
Do you have any suggestions to harden this dependancy and ensure initWMTabs
is available in this situation?
🤔 off the top of my head, will need to look at deferring initTabs to DOMContentLoaded
or similar.
Perhaps a preload
link will help
Using a preload link did not relieve this issue.
I suggest we move when/where the tabs.js
script is included to the widget itself.
Fixed in #170
Issue Summary
MediaChooserPanel
opens model but tabs are empty.The following error is thrown in the console.
initWMTabs
is available in the global scope. If manually called from the console after opening the panel, the next time the panel opens it works as expected.Steps to Reproduce
wagtailmedia
into projectForeignKey
field with typeMedia
to anyPage
MediaChooserPanel
inPage.content_panels
Technical details
wagtailmedia
version: 0.10.1