wagtail-nest / wagtail-review

A Wagtail extension for gathering annotations and feedback on pages before publication
BSD 3-Clause "New" or "Revised" License
49 stars 19 forks source link

KeyError: 'page' when creating new page #41

Closed StuMaitland closed 3 years ago

StuMaitland commented 3 years ago

I can edit existing pages, but on creating new pages, I get the following error:

KeyError
'page'

from:

# editor where we also have the page ID
class GuacamoleMenuItem(ActionMenuItem):
    def render_html(self, request, context):
        return mark_safe(f"<script>window.wagtailPageId = {context['page'].id};</script>")

Wagtail version 2.10

gasman commented 3 years ago

Thanks @stuartbman! Looks like this is the issue that was previously reported and fixed in #22, but it ended up getting rolled back when the integration with Wagtail 2.10's workflow features didn't happen... re-fixing now, and will get a patch release out shortly.

StuMaitland commented 3 years ago

Thanks very much, that's great!