Skip to content

Commit

Permalink
fix issue #111
Browse files Browse the repository at this point in the history
This alway happens, when an edit form has validation errors and returns
back with the prefilled values from the request which are in fact
basestring types and get joined by the separator as described above.
  • Loading branch information
petschki committed Oct 27, 2016
1 parent 093b80e commit 4a55b9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,10 @@ Changelog
1.9.1 (unreleased)
------------------

- Fix value for at.AjaxSelectWidget when the edit form returns with
validation errors
[petschki]

- Use the RAW text for Archetypes based TinyMCE content, this fixes
image handling with TinyMCE.
[pcdummy]
Expand Down
6 changes: 4 additions & 2 deletions plone/app/widgets/at.py
Expand Up @@ -359,8 +359,10 @@ def _base_args(self, context, field, request):
self.vocabulary = vocabulary_factory

args['name'] = field.getName()
args['value'] = self.separator.join(request.get(
field.getName(), field.getAccessor(context)()))
value = request.get(field.getName(), field.getAccessor(context)())
if isinstance(value, basestring):
value = value.split(self.separator)
args['value'] = self.separator.join(value)

args.setdefault('pattern_options', {})
args['pattern_options'] = dict_merge(
Expand Down

0 comments on commit 4a55b9f

Please sign in to comment.