Open thibaudcolas opened 1 year ago
This is probably because of the following code https://github.com/wagtail/guide/blob/195797c837557fd13cf91af38b8fcf4964020748/apps/core/models/content.py#L47-L55
It doesn't return the context at all if the page is not live. It should be changed to something like
def get_context(self, request, *args, **kwargs):
context = super().get_context(request, *args, **kwargs)
if self.live and self.show_in_menus:
pages = Page.objects.live().in_menu()
context.update(
previous=pages.filter(path__lt=self.path).last(),
next=pages.filter(path__gt=self.path).first(),
)
return context
https://guide.wagtail.org/admin/pages/213/view_draft/
If a page has never been published, we can’t use the live preview, nor
view_draft
.Perhaps related to wagtail-localise field replacement not happening for drafts