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

unicodedecode error rendering richtexttile #111

Open
djay opened this issue Feb 3, 2021 · 2 comments
Open

unicodedecode error rendering richtexttile #111

djay opened this issue Feb 3, 2021 · 2 comments

Comments

@djay
Copy link
Member

djay commented Feb 3, 2021

2021-02-04 01:17:18,944 - plone.subrequest - ERROR - Error handling subrequest to http://localhost:63339/plone/testdoc/@@plone.app.standardtiles.field?field=IRichText-text&X-Tile-Persistent=yes
Traceback (most recent call last):
  File "/Users/dylanjay/Projects/download-cache/eggs/plone.subrequest-1.8.7-py2.7.egg/plone/subrequest/__init__.py", line 155, in subrequest
    bind=1
  File "/Users/dylanjay/Projects/download-cache/eggs/Zope2-2.13.30-py2.7.egg/ZPublisher/mapply.py", line 78, in mapply
    else: return object(*args)
  File "/Users/dylanjay/Projects/download-cache/eggs/plone.app.standardtiles-2.3.2-py2.7.egg/plone/app/standardtiles/field.py", line 123, in __call__
    return self._wrap_widget(widget.render())
  File "/Users/dylanjay/Projects/download-cache/eggs/plone.app.standardtiles-2.3.2-py2.7.egg/plone/app/standardtiles/field.py", line 96, in _wrap_widget
    if render.rstrip().endswith(u'</html>'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)

Shown in this test https://github.com/collective/collective.collectionfilter/runs/1824792008?check_suite_focus=true

@djay
Copy link
Member Author

djay commented Jun 30, 2021

The bug is here #111

in previous versions this code was which handled if the render was not unicode?

    def _wrap_widget(self, render):
        print(type(render))
        if unicode(render).rstrip().endswith(u'</html>'):
            return render

@djay
Copy link
Member Author

djay commented Jul 1, 2021

Seems this was fixed by collective/collective.collectionfilter@eefcb8a.
Not sure why this breaks tiles but not other schema forms so it's still perhaps a bug.

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

1 participant