Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail v4 new page issue persists #208

Closed
ethanaward opened this issue Dec 9, 2022 · 4 comments
Closed

Wagtail v4 new page issue persists #208

ethanaward opened this issue Dec 9, 2022 · 4 comments

Comments

@ethanaward
Copy link

Expected behaviour

I am able to add the streamforms WagtailFormBlock to a StreamField on my page and then insert an existing form.

Actual behaviour

Attempting to access the page results in the following error, identical to the one described in #200:

Traceback (most recent call last):
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/contrib/staticfiles/handlers.py", line 76, in __call__
    return self.application(environ, start_response)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 133, in __call__
    response = self.get_response(request)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/base.py", line 130, in get_response
    response = self._middleware_chain(request)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/exception.py", line 49, in inner
    response = response_for_exception(request, exc)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/exception.py", line 114, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/exception.py", line 149, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django_extensions/management/technical_response.py", line 40, in null_technical_500_response
    raise exc_value.with_traceback(tb)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/core/handlers/base.py", line 204, in _get_response
    response = response.render()
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/auth.py", line 197, in overridden_render
    return render()
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/response.py", line 105, in render
    self.content = self.rendered_content
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/response.py", line 83, in rendered_content
    return template.render(context, self._request)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 988, in render
    output = self.filter_expression.resolve(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 671, in resolve
    obj = self.var.resolve(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 796, in resolve
    value = self._resolve_lookup(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 858, in _resolve_lookup
    current = current()
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/panels.py", line 392, in render_form_content
    return mark_safe(self.render_html() + self.render_missing_fields())
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/ui/components.py", line 20, in render_html
    return template.render(context_data)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/defaulttags.py", line 214, in render
    nodelist.append(node.render_annotated(context))
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 988, in render
    output = self.filter_expression.resolve(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 671, in resolve
    obj = self.var.resolve(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 796, in resolve
    value = self._resolve_lookup(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 858, in _resolve_lookup
    current = current()
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/ui/components.py", line 20, in render_html
    return template.render(context_data)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/defaulttags.py", line 214, in render
    nodelist.append(node.render_annotated(context))
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/templatetags/wagtailadmin_tags.py", line 948, in render
    children = self.nodelist.render(context) if self.nodelist else ""
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/template/library.py", line 192, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/templatetags/wagtailadmin_tags.py", line 876, in component
    return obj.render_html(context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/ui/components.py", line 15, in render_html
    context_data = self.get_context_data(parent_context)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/admin/panels.py", line 814, in get_context_data
    rendered_field = self.bound_field.as_widget(attrs=widget_attrs)
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/django/forms/boundfield.py", line 93, in as_widget
    return widget.render(
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/blocks/base.py", line 552, in render
    return self.render_with_errors(
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/blocks/base.py", line 546, in render_with_errors
    block_json=self.block_json,
  File "/Users/eward/.virtualenvs/foley/lib/python3.10/site-packages/wagtail/blocks/base.py", line 523, in block_json
    return self._block_json
AttributeError: 'BlockWidget' object has no attribute '_block_json'

Steps to reproduce the behaviour

Create a new project with the WagtailFormBlock as an option in a StreamField for a page. Attempt to access one of those pages, and you get the above error.

@TonisPiip
Copy link

+1 very annoying. I'm glad the devs have done a release to allow for a hotfix while using v4, but they should really apply the hotfix themselves and make another release...

@TonisPiip
Copy link

There are some hack solutions which do work, it does allow for v4. But it's not pretty, better than having to fork the project though.
#200 (comment)

@VdeJong
Copy link
Contributor

VdeJong commented Mar 17, 2023

With the new release, 3.22, just should be fixed. Let me know if that version works for you @ethanaward

@ethanaward
Copy link
Author

Yep, looks like the latest update fixed it for me! I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants