ietf-tools / www

A customized CMS for the IETF website
BSD 3-Clause "New" or "Revised" License
22 stars 45 forks source link

Editor crashes on pages under construction. #337

Closed rjsparks closed 2 months ago

rjsparks commented 9 months ago

fwiw, the URL started with /live/

Internal Server Error: (some URL being worked on)

AttributeError at (that URL)
'StandardIndexPage' object has no attribute 'reverse_subpage'

Request Method: GET
Request URL: http://www.ietf.org/(that URL)

...

  File "/usr/local/lib/python3.10/site-packages/django/template/library.py", line 192, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/usr/local/lib/python3.10/site-packages/wagtail/contrib/routable_page/templatetags/wagtailroutablepage_tags.py", line 25, in routablepageurl
    routed_url = page.reverse_subpage(url_name, args=args, kwargs=kwargs)

Exception Type: AttributeError at (that URL)
Exception Value: 'StandardIndexPage' object has no attribute 'reverse_subpage'

Crash rate was high while page was being worked on (19 crashes in 2 minutes)

cc: @ghwood

mgax commented 3 months ago

I was able to reproduce the error by creating a BlogPage under /live/ (which is an IndexPage). While editing the blog page, the live preview was crashing, because the blog page's template is trying to render links to sibling blog posts using the {% routablepageurl %} template tag: https://github.com/ietf-tools/www/blob/722378b614048b4ad9ec0be8f6dc505f88a2caf9/ietf/blog/templates/includes/blog_sidebar.html#L24