wagtail-localize
wagtail-localize copied to clipboard
Can't translate a page with a OneToOneField
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...

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.
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.
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.