saromba
(Sascha)
May 10, 2017, 11:43am
1
I have a Plone 4.3.12 with collective.ckeditor 4.4.5.
If I add an image via "Image Plugin" the final URL is like
resolveuid/cd982d7c5a824d25834a88fea80abeaf/@@images/image/preview
The "Preview Plugin" can't display the images correctly.
Firebug console output:
"NetworkError: 404 Not Found - http://mydomain/Plone/++resource++ckeditor/plugins/preview/resolveuid/960eb309fe6e41d09ec8dfc34be9639c/@@images/image/preview"
How can I fix that?
Or maybe better: How can I add the base_url to the image URL ("http://mydomain/Plone/resolveuid/960 ...")
Thanks.
hvelarde
(hvelarde)
May 10, 2017, 1:11pm
2
seems to be related with this:
The base tag href attribute value no longer (since 4.3.12) points to the context object when in e.g. an edit view. Sadly this breaks JS code that relied on the old behavior.
How should the context object url be fetched in JS now?
UPDATE: Found an old discussion on this .
Apparently this change also broke Plone inline validation (since fixed using a case-specific solution that cannot be used as a global fix).
saromba
(Sascha)
May 11, 2017, 5:54am
3
Hmmm...I read that (loo paper) topic. But what is the solution?
In my custom package I can modify CKEditor params like this:
overrides.zcml:
<browser:page
name="ckeditor_plone_config.js"
for="zope.interface.Interface"
class=".ckeditorview.CKeditorView"
attribute="getCK_plone_config"
permission="zope.Public"
/>
And here is the ckeditorview.py:
from collective.ckeditor.browser.ckeditorview import CKeditorView as BaseView
class CKeditorView(BaseView):
"""
CKeditor overrides
"""
def getCK_plone_config(self):
res = super(CKeditorView, self).getCK_plone_config()
return res
@property
def cke_params(self):
params = super(CKeditorView, self).cke_params
# for example...
params['filebrowserBrowseUrl'] = "''"
return params
This must not be a widely used package, so your best bet is to file an issue in the repo or contact one of the maintainers of the package.