Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SvgChooserBlock doesn't show up preview svg image StreamField. #8

Open
rafagarciac opened this issue May 19, 2021 · 7 comments
Open

Comments

@rafagarciac
Copy link

rafagarciac commented May 19, 2021

Hi @Aleksi44 !! I'm trying to implement this awesome package to the application with the following versions:

# requirements.txt
Django>3.1,<3.2
wagtail==2.10.2
wagtail-generic-chooser==0.1.1
# wagtailsvg==0.0.14 CUSTOM FORK

Because of wagtail version (2.10.2), I'm using a fork built-in project of this repository, in order to fix the migrations problems, change 0059_apply_collection_ordering to 0052_pagelogentry in 0001_initial.py migration file.

Everything works perfect until, I try to use SvgChooserBlock.

After integrate and build up the custom fork of wagtailsvg with version 0.0.14, I added the following StreamField to my custom page like that:

svg = StreamField([
        ('svg', SvgChooserBlock()),
    ], blank=True)

Now, the problems comes when I cannot previsualize the image inside block on StreamFieldPanel, it looks like this:
Link image preview

Thank for your support.
Cheers !

@rafagarciac rafagarciac changed the title SvgChooserBlock does not render preview on edit page. Not value SvgChooserBlock doesn't show up preview svg image StreamField. Not value May 19, 2021
@rafagarciac rafagarciac changed the title SvgChooserBlock doesn't show up preview svg image StreamField. Not value SvgChooserBlock doesn't show up preview svg image StreamField. May 19, 2021
@Aleksi44
Copy link
Owner

Hi @rafagarciac

Do you have javascript errors in the console?
Can you test your project with this version:

pip install wagtailsvg==0.0.11

It is possible that the problem is related to #7 for wagtail 2.13 support.

@rafagarciac
Copy link
Author

rafagarciac commented May 19, 2021

@Aleksi44
I don't have any JS errors in the console.
Why would I change the wagtailsvg version to 0.0.11 since there isn't any change related to SvgChooserBlock or AdminSvgChooser which is the error where I'm getting from... 🤔 ??

The problem related to #7 is for wagtail 2.13, so I don't think is related because my Wagtail version is 2.10.2.
Thanks for your quickly reply !

@Aleksi44
Copy link
Owner

The SVG preview in Streamfield is handled differently in wagtail 2.13 than in previous versions.

wagtailsvg==0.0.14 uses the wagtail 2.13 implementation
wagtailsvg==0.0.11 uses the implementation of older versions of wagtail

@rafagarciac
Copy link
Author

rafagarciac commented May 19, 2021

I changed the wagtailsvg version from 0.0.14 to 0.0.11 and still does not work.
It does not include usefull change to SvgChooserBlock or AdminSvgChooser from the version that I had. (0.0.14).

Do you think is it something related about wagtail version itself 2.10.2 ?

@Aleksi44 Any idea ? 🤔

@Aleksi44
Copy link
Owner

I had the same problem when wagtail released version 2.13, you can see it here.

Some hints that might help you :

  • all your static files are fetched? (no 404)
  • check your wagtail version (pip freeze)

If you still can't find it, I can help you if you create a public repository to reproduce the bug.

@rafagarciac
Copy link
Author

Hi @Aleksi44, I've already created a WagtailSVG Test Project, to run this project in isolation and it works perfectly !

I also I've detected that the bug I'm getting in the is related with the following wagtail package: wagtail-react-streamfield.
https://github.com/wagtail/wagtail-react-streamfield and isn't related with wagtailsvg itself. 👌🏼

For the other hand, I've updated the WagtailSVG Test Project with the package wagtail-react-streamfield, in order to check what is causing this problem and try to fix it as soon as possible.

Finally, I found this related issue wagtail-deprecated/wagtail-react-streamfield#26 on wagtail-react-streamfield package.

Thanks again.

@Aleksi44
Copy link
Owner

I'm glad you found the reason :)
I'll leave the ticket open if it helps anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants