#4 — Adding/editing Success Story rotating portlet error when Success Story Folder title contains non-ascii (utf-8) characters
by
Rebel X
—
last modified
Jun 19, 2011 03:13 PM
| State | Unconfirmed |
|---|---|
| Version: | 4.0.0 |
| Area | Functionality |
| Issue type | Bug |
| Severity | Medium |
| Submitted by | Rebel X |
| Submitted on | Jun 19, 2011 |
| Responsible |
—
|
| Target release: |
—
|
When adding or editing a Success Story rotating portlet, the following error may occur when a Success Story Folder title contains non-ascii (utf-8) characters:
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module plone.app.portlets.browser.formhelper, line 123, in __call__
Module zope.formlib.form, line 782, in __call__
Module five.formlib.formbase, line 50, in update
Module zope.formlib.form, line 745, in update
Module zope.formlib.form, line 820, in setUpWidgets
Module zope.formlib.form, line 384, in setUpEditWidgets
Module zope.schema._field, line 293, in bind
Module Products.Five.schema, line 36, in get
Module Products.ATSuccessStory.vocabularies, line 25, in existingSSFolders
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 30: ordinal not in range(128)
This can be resolved by modifying vocabularies.py, by replacing:
for value in results:
path = value.getPath()
terms.append(SimpleVocabulary.createTerm(path, path, u'%s - %s'%(value.Title, value.getPath())))
with:
for value in results:
path = value.getPath()
title = value.Title
title = title.decode('utf-8')
terms.append(SimpleVocabulary.createTerm(path, path, u'%s - %s'%(title, path)))
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module plone.app.portlets.browser.formhelper, line 123, in __call__
Module zope.formlib.form, line 782, in __call__
Module five.formlib.formbase, line 50, in update
Module zope.formlib.form, line 745, in update
Module zope.formlib.form, line 820, in setUpWidgets
Module zope.formlib.form, line 384, in setUpEditWidgets
Module zope.schema._field, line 293, in bind
Module Products.Five.schema, line 36, in get
Module Products.ATSuccessStory.vocabularies, line 25, in existingSSFolders
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 30: ordinal not in range(128)
This can be resolved by modifying vocabularies.py, by replacing:
for value in results:
path = value.getPath()
terms.append(SimpleVocabulary.createTerm(path, path, u'%s - %s'%(value.Title, value.getPath())))
with:
for value in results:
path = value.getPath()
title = value.Title
title = title.decode('utf-8')
terms.append(SimpleVocabulary.createTerm(path, path, u'%s - %s'%(title, path)))
No responses can be added.
If you can, please log in before submitting a reaction.
