#13 — Sending images added with Kupu/TinyMCE buttons fails

by Dinu Gherman last modified Oct 03, 2011 01:39 PM
State Unconfirmed
Version:
Area Functionality
Issue type Bug
Severity Critical
Submitted by Dinu Gherman
Submitted on Feb 11, 2011
Responsible
Target release:
Images added by clicking the image button in rich text editors like Kupu or TinyMCE show up on the Plone site, but cause an error when sending the issue.

It seems like this was a known but undocumented limitation, which is sad because it results in useless testing efforts by end users.

Adding an image in the HTML mode of the rich text editor as a img element with an address in the href attribute seems to work, though, but is less user-friendly for less HTML-aware people writing newsletter issues.
Added by Dinu Gherman on Feb 11, 2011 03:15 PM
Severity: ImportantCritical
It's actually worse, because even remote images cannot be added, also not directly in HTML mode. It seems that only local images are sent in newsletter issues although they appear on the Plone page just fine, of course.

Still worse, an image address must be best given with an absolute URL, but not one redirected somewhere else, like Plone often does e.g. with resolveuid/72a3cd29a6a80039efac551e.

All these cases are not covered in the current code, and still http://pypi.python.org/pypi/Products.EasyNewsletter claims as its first feature: "Support Text and HTML Newsletter (including images)".
Added by Régis Rouet on Sep 08, 2011 05:52 PM
I noticed some failure (on svn version) because of the leading "/" of the image's url.

The template I used is used on news items and contains :

    <div class="newsImageContainer">
      <a tal:attributes="href url" tal:condition="item/getImage|nothing">
        <img tal:attributes="src string:$url/image_mini" src="" alt="" class="newsImage"/>
      </a>
    </div>

Added by Régis Rouet on Sep 12, 2011 12:54 PM
whole template :

<tal:block tal:repeat="object context/queryCatalog">
<tal:define tal:define="url object/getURL; item object/getObject">

  <div class="item visualIEFloatFix">
      <a tal:attributes="href url" tal:content="object/Title" class="summary url">Title</a>
    <div class="newsImageContainer">
      <a tal:attributes="href url" tal:condition="item/getImage|nothing">
        <img tal:attributes="src string:$url/image_thumb" src="" alt="" class="newsImage"/>
      </a>
    </div>
    <div class="visualClear"><!-- --></div>
  </div>
</tal:define>
</tal:block>
Added by Régis Rouet on Sep 12, 2011 01:56 PM
made others test
some issues may be related to http://plone.org/products/easynewsletter/issues/32

test 1
- refresh
- edit draft, change format to html, save
- send draft
-> error

2011-09-12 15:26:22 ERROR Products.EasyNewsletter Could not resolve the image "/fr/actualites/my-news-item/image_thumb": 'fr'
> /opt/plone-4.1/buildout-cache/eggs/Products.PDBDebugMode-1.3.1-py2.6.egg/Products/PDBDebugMode/pdblogging.py(54)error()
-> return result
(Pdb) s
(Pdb) s
(Pdb) image_url
'/fr/actualites/my-news-item/image_thumb'


test 2
- refresh
- edit draft, change format to html, save
- edit draft, save
- send draft
-> no error !


also tested image inserted via editor with uuid links

<img class="image-inline" src="resolveuid/651558df-eaff-4de2-9536-a6aecf93c20c" />

-> ok

<img class="image-inline" src="resolveuid/dc0ad0eb-dbd6-4082-bf8c-209e1f795178/@@images/image/tile" />

-> error
  Module Products.EasyNewsletter.content.ENLIssue, line 403, in send
AttributeError: 'ImageScaling' object has no attribute 'GET'
(Pdb) o
<Products.Five.metaclass.ImageScaling object at 0xef5894c>


tests made on rev 244084 (before fix for external images)
Added by Régis Rouet on Oct 03, 2011 01:39 PM
see http://stackoverflow.com/[…]/disable-tinymce-url-conversions

I've opted for not embedding images and use absolute urls without hostname.

see bpi-rouet-2011-09 branch for implementation

No responses can be added.