Skip to content

Commit 12b6cf1

Browse files
authored
Merge pull request #4135 from plone/tinymce-contentbrowser-options-6.2
Fix TinyMCE relatedItems options [6.2]
2 parents 9153d80 + bef4e52 commit 12b6cf1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Products/CMFPlone/patterns/settings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from borg.localrole.interfaces import IFactoryTempFolder
44
from plone.app.content.browser.interfaces import IFolderContentsView
55
from plone.app.z3cform.utils import call_callables
6-
from plone.app.z3cform.widgets.relateditems import get_relateditems_options
6+
from plone.app.z3cform.widgets.contentbrowser import get_contentbrowser_options
77
from plone.base.interfaces import IImagingSchema
88
from plone.base.interfaces import ILinkSchema
99
from plone.base.interfaces import IPatternsSettings
@@ -137,15 +137,15 @@ def tinymce(self):
137137
server_url = self.request.get("SERVER_URL", "")
138138
site_path = portal_url[len(server_url) :]
139139

140-
related_items_config = get_relateditems_options(
140+
contentbrowser_config = get_contentbrowser_options(
141141
context=self.context,
142142
value=None,
143143
separator=";",
144144
vocabulary_name="plone.app.vocabularies.Catalog",
145145
vocabulary_view="@@getVocabulary",
146146
field_name=None,
147147
)
148-
related_items_config = call_callables(related_items_config, self.context)
148+
contentbrowser_config = call_callables(contentbrowser_config, self.context)
149149

150150
configuration = {
151151
"base_url": self.context.absolute_url(),
@@ -156,7 +156,7 @@ def tinymce(self):
156156
"pictureVariants": self.picture_variants,
157157
"imageCaptioningEnabled": self.image_captioning,
158158
"linkAttribute": "UID",
159-
"relatedItems": related_items_config,
159+
"relatedItems": contentbrowser_config,
160160
"prependToScalePart": "/@@images/image/",
161161
"prependToUrl": "{}/resolveuid/".format(site_path.rstrip("/")),
162162
"inline": settings.inline,

news/4133.bugfix

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Use contentbrowser options for TinyMCE image/link browser.
2+
This also fixes the basePath calculation for uploading.
3+
[petschki]

0 commit comments

Comments
 (0)