I have 3 users using IE 11.0 on Windows 10 which throw a TypeError: the JSON object must be str, bytes or bytearray, not NoneType when previewing the page.
The key issue is 'body' missing from the data dict. Body is not a required field, but for some reason value_from_datadict attempts to get the nonexistent value and returns None.
stream_field_data = json.loads(data.get(name))
I haven't been able to reproduce the issue on my Mac running Chrome (Version 86.0.4240.111). I wonder if there is something the users are doing that is unique to IE (similar to https://github.com/wagtail/wagtail/issues/1697).
Version Info:
Django 2.2.13
Wagtail 2.9.3
wagtail_react_streamfield 1.3.5
Python 3.8.5
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
File "django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "wagtail/admin/urls/__init__.py", line 109, in wrapper
return view_func(request, *args, **kwargs)
File "wagtail/admin/auth.py", line 188, in decorated_view
return view_func(request, *args, **kwargs)
File "django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "django/views/generic/base.py", line 97, in dispatch
return handler(request, *args, **kwargs)
File "wagtail/admin/views/pages.py", line 664, in post
return JsonResponse({'is_valid': form.is_valid()})
File "modelcluster/forms.py", line 316, in is_valid
form_is_valid = super(ClusterForm, self).is_valid()
File "django/forms/forms.py", line 185, in is_valid
return self.is_bound and not self.errors
File "django/forms/forms.py", line 180, in errors
self.full_clean()
File "django/forms/forms.py", line 381, in full_clean
self._clean_fields()
File "django/forms/forms.py", line 393, in _clean_fields
value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
File "wagtail_react_streamfield/widgets.py", line 118, in value_from_datadict
stream_field_data = json.loads(data.get(name))
File "json/__init__.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
I have 3 users using IE 11.0 on Windows 10 which throw a
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
when previewing the page.The key issue is 'body' missing from the data dict. Body is not a required field, but for some reason value_from_datadict attempts to get the nonexistent value and returns None.
stream_field_data = json.loads(data.get(name))
I haven't been able to reproduce the issue on my Mac running Chrome (Version 86.0.4240.111). I wonder if there is something the users are doing that is unique to IE (similar to https://github.com/wagtail/wagtail/issues/1697).
Version Info:
Data Dict: