wagtail-polymath icon indicating copy to clipboard operation
wagtail-polymath copied to clipboard

MathJax streamblock widget initially works, then doesn't

Open bbrelje opened this issue 7 years ago • 1 comments

Hey there, great work on this plugin! It worked great as I edited and published my first test post using equations and the MathJax streamblock widget.

Unfortunately, after I saved a draft of the page for the first time, I went back to edit the test page (add another MathJax widget instance) and observed the following symptoms:

  • Live preview window in the existing MathJax widget instance non-responsive
  • Live preview window in the new MathJax widget non-responsive
  • An extra / phantom stream field appears below the new MathJax widget. It has no content, just shows up as black when moused over, background color otherwise
  • Delete and up/down arrows in the MathJax streamblock widget do nothing (on the newly created widget instance) and work normally (on the old widget instance)
  • Saving the page in this state (draft or publish) results in the error below
  • Waiting some length of time (on the order of 10s of minutes) resolves the problem temporarily
  • MathJax expressions still render properly on the live pages when I introduce it as RawHTML streamblock content (so I don't think it's a browser issue with MathJax)

The problem is not universal to all cases with multiple MathJax widgets on one page. I had live previews of two MathJax widgets working at the same time on one occasion.

I think the problem may be related to the GUI changes introduced in wagtail 1.12 but I could easily be wrong about that.

Stack trace:
invalid literal for int() with base 10: ''

Traceback:

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/views/decorators/cache.py" in _cache_controlled
  43.             response = viewfunc(request, *args, **kw)

File "/opt/bitnami/python/lib/python2.7/site-packages/wagtail/wagtailadmin/decorators.py" in decorated_view
  31.             return view_func(request, *args, **kwargs)

File "/opt/bitnami/python/lib/python2.7/site-packages/wagtail/wagtailadmin/views/pages.py" in edit
  321.         if form.is_valid() and not page.locked:

File "/opt/bitnami/python/lib/python2.7/site-packages/modelcluster/forms.py" in is_valid
  259.         form_is_valid = super(ClusterForm, self).is_valid()

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/forms/forms.py" in is_valid
  183.         return self.is_bound and not self.errors

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/forms/forms.py" in errors
  175.             self.full_clean()

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/forms/forms.py" in full_clean
  384.         self._clean_fields()

File "/opt/bitnami/apps/django/lib/python2.7/site-packages/Django-1.11.4-py2.7.egg/django/forms/forms.py" in _clean_fields
  396.                 value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))

File "/opt/bitnami/python/lib/python2.7/site-packages/wagtail/wagtailcore/blocks/base.py" in value_from_datadict
  523.         return self.block_def.value_from_datadict(data, files, name)

File "/opt/bitnami/python/lib/python2.7/site-packages/wagtail/wagtailcore/blocks/stream_block.py" in value_from_datadict
  165.                     int(data['%s-%d-order' % (prefix, i)]),

Exception Type: ValueError at /admin/pages/5/edit/
Exception Value: invalid literal for int() with base 10: ''

bbrelje avatar Sep 12 '17 04:09 bbrelje

Hi Thanks for reporting this. I haven't made any updates/checked any breakages for wagtail 1.12, so this would be my first port of call. I'll do some tests, if you are able, it would help to test with a previous version of wagtail to verify it is isolated to 1.12.

JamesRamm avatar Sep 13 '17 07:09 JamesRamm

Will close this as there hasn't been any update for a good while

zerolab avatar Aug 02 '24 14:08 zerolab