plone / plone.app.widgets

Integrating plone.widgets into plone
Other
7 stars 38 forks source link

RichTextWidget cannot be rendered in some contexts #161

Closed petschki closed 7 years ago

petschki commented 7 years ago

Use case:

Plone 4.3-latest plone.app.widgets/1.x collective.cover/master

We've implemented plone modals for editing the cover-tiles. Everything works good except the RichText widget. This is because the tile context is a simle dict object and therefore the get_tinymce_optionsfalls back to plone5 behaviour :/ . With a small and already existing method from plone.app.textfield we get the wrapped_context of the widget and are able to render it correctly for the tiles. see the code here: https://github.com/collective/collective.cover/blob/67258bf457c16e96731ed40816e6464f08395563/src/collective/cover/widgets/richtext.py

My question is: should this enhancement rather be implemented in p.a.widgets?

@thet any thoughts?

hvelarde commented 7 years ago

yes, I think that makes more sense in the context of plone.app.widgets.

petschki commented 7 years ago

haha ... no way ... @thet I've just stumbled upon your latest pull request: https://github.com/plone/plone.app.widgets/pull/160 ... this is exactly the same problem we had mentioned above. I'd rather recommend to use self.wrapped_context() from p.a.textfield instead of fallback to the root ...

thet commented 7 years ago

Closed via: https://github.com/plone/plone.app.widgets/pull/163 For 5.x: https://github.com/plone/plone.app.widgets/pull/160