wagtail / wagtail-localize

Translation plugin for Wagtail CMS
https://wagtail-localize.org/
Other
227 stars 87 forks source link

Can't translate a page with a OneToOneField #542

Open drcongo opened 2 years ago

drcongo commented 2 years ago

I'm not sure yet if this is a Wagtail-localize issue or a Wagtail issue, but if you have a page with a OneToOneField then trying to translate it fails silently with no errors logged.

class TopicPage(Taggable, LandingPageType):

    class Meta:
        verbose_name = 'Topic page'

    topic = models.OneToOneField(
        'taxonomy.PageTag',
        null=False,
        blank=False,
        on_delete=models.PROTECT,
        related_name='topic_page',
        help_text=_("The topic this page is about")
    )

In the Reports->Translations section, these show up without a page title...

Screen Shot 2022-03-16 09 18 03 AM

The (French) bit in there is linking to the page I'm already on. It kinda feels like this is obvious that the system wouldn't be able to duplicate a page with a OneToOneField as that would no longer be one to one, but the fact that the translations appear (although broken) in the reports could be misleading for a site editor.

zerolab commented 2 years ago

I find it odd that it fails silently 🤔 Perhaps we're not doing appropriate cleanup. If you happened to dig into this more, any further details will be greatly appreciated.

drcongo commented 2 years ago

I'll see what I can find @zerolab - I should mention I hadn't noticed 1.1 was out at the point I posted this so this was the prior version.