Skip to content

Commit

Permalink
Merge pull request #101 from plone/fix-tinymce-widget-accessor
Browse files Browse the repository at this point in the history
We want to edit the raw text
  • Loading branch information
davisagli authored Mar 28, 2018
2 parents 8869833 + e25765a commit 0b66e72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ New features:

Bug fixes:

- Use the edit accessor to get text for TinyMCEWidget.
[davisagli]

- Fix test failures from https://github.com/plone/plone.app.widgets/pull/177
[thet]

Expand Down
2 changes: 1 addition & 1 deletion Products/Archetypes/Widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ def _base_args(self, context, field, request):
args = super(TinyMCEWidget, self)._base_args(context, field, request)
args['name'] = field.getName()
args['value'] = (request.get(field.getName(),
field.getAccessor(context)())
field.getEditAccessor(context)())
).decode('utf-8')

args.setdefault('pattern_options', {})
Expand Down
2 changes: 1 addition & 1 deletion Products/Archetypes/tests/test_pawidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def setUp(self):
self.portal = self.layer['portal']
self.request = TestRequest(environ={'HTTP_ACCEPT_LANGUAGE': 'en'})
self.field = Mock()
self.field.getAccessor.return_value = lambda: 'fieldvalue'
self.field.getEditAccessor.return_value = lambda: 'fieldvalue'
self.field.getName.return_value = 'fieldname'
self.field.getContentType.return_value = 'text/html'

Expand Down

0 comments on commit 0b66e72

Please sign in to comment.