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

Inlines trigger error upon save #346

Closed
jkoestinger opened this issue Feb 23, 2021 · 3 comments · Fixed by #454
Closed

Inlines trigger error upon save #346

jkoestinger opened this issue Feb 23, 2021 · 3 comments · Fixed by #454
Labels
type:bug Something isn't working
Milestone

Comments

@jkoestinger
Copy link

Hi, first thank you for the work on this project

I tried to implement the base example for the form builder (provided there: https://docs.wagtail.io/en/latest/reference/contrib/forms/#usage) and I ran into the following issue:

  • The FormField is not translatable, so it does not show in the translated page, that's expected
  • If I add the TranslatableMixin to the FormField, I get the following error when saving the original page:
    Capture d’écran 2021-02-23 à 14 55 10

Is there something that I missed? Also, I'm not 100% sure whether it concerns this project or the Wagtail project directly

@kaedroho
Copy link
Contributor

kaedroho commented Mar 5, 2021

Hi @jkoestinger

If you're adding TranslatableMixin to a model with existing data Django will try to assign the same UUID to every value in the model causing an error like this.

The way to solve this is to use the BootstrapTranslatableMixin method described in https://docs.wagtail.io/en/stable/advanced_topics/i18n.html#making-snippets-with-existing-data-translatable

The title "Making snippets with existing data translatable" is a little misleading as it applies to child objects too, I'll fix that!

@jkoestinger
Copy link
Author

jkoestinger commented Mar 5, 2021

Hi, thanks for your response.

Sorry, my initial message was unclear: I actually removed the model (by unapplying the migration and deleting it) directly before adding the mixin, so I think the BootstrapTranslatableMixin step should not be needed in this case, right?

@kaedroho
Copy link
Contributor

kaedroho commented Mar 5, 2021

Yep, that's correct. I've just managed to replicate this locally and can confirm it's a bug, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants