Open murray3k opened 3 years ago
any advancement in this fix?
@murray3k do you have an idea when they will merge your PR? I really need this fix, were you able to resolve it?
@BertrandBordage is there any possibility to add this PR? thank you
For people interested in this for Wagtail 2.11 compatibility, @kedmundson has made a branch including the fix from this PR and committing the project’s static files to git, so the fix can be installable without publishing to pypi.
I have just un-archived this project and pushed the branch here so it’s easier to find: https://github.com/wagtail/wagtail-react-streamfield/tree/pr-69-wagtail-2.11-snippetchooser-fix. With pip, you can install this from GitHub’s ZIP archives of branches:
pip install https://github.com/wagtail/wagtail-react-streamfield/archive/pr-69-wagtail-2.11-snippetchooser-fix.zip
I would only recommend this for people still using Wagtail 2.11 and unable to upgrade at this time. Otherwise the wagtail-react-streamfield
project is no longer supported as we’ve merged most functionality in Wagtail 2.13.
I’ll archive this again now – people still using this can discuss further on the Wagtail Slack in #react-streamfield
.
Since wagtail 2.11.1 the snippetChooser gets its URL from a data-attribute and longer from chooserUrls in the global scope. This should fix the issue and be backwards compatible, by checking if
snippetChooser
exists inwindow.chooserUrls
or else getting it from the data-attribute.