Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing images after inserted in TinyMCE breaks content #2465

Closed
Netroxen opened this issue Jul 4, 2018 · 3 comments
Closed

Editing images after inserted in TinyMCE breaks content #2465

Netroxen opened this issue Jul 4, 2018 · 3 comments

Comments

@Netroxen
Copy link
Member

Netroxen commented Jul 4, 2018

Scenarios

Scenario 1

  1. Open image dialog in TinyMCE editor
  • Default ( Large 768x768 )
  1. Go to "Upload" tab
  • Select an image from the local disk
  • Click "Insert" or "Upload" and then "Insert"
  1. Navigate to the image and "Settings" tab
  • Select "Exclude from navigation"
  1. Navigate back to parent item ( Content-Type the image was inserted on )
  • The image is no longer shown, only the filename...
  1. Go into edit mode and click "Save" again
  • The image is now visible and also excluded from the navigation...

Scenario 2

  1. Open image dialog in TinyMCE editor
  • Select ( Preview 400x400 )
  1. Go to "Upload" tab
  • Select an image from the local disk
  • Click "Insert" or "Upload" and then "Insert"
  1. Navigate to the image and "Settings" tab
  • Select "Exclude from navigation"
  1. Navigate back to parent item ( Content-Type the image was inserted on )
  • This time the image is still shown...

Example

plone51-2018-07-04 10-48

Expected

When inserting an image in the TinyMCE editor, I often want to exclude it from the navigation. However doing this in the current state causes the image to disappear from the content.

  1. Open image dialog in TinyMCE editor
  • Select any image scale or default
  1. Go to "Upload" tab
  • Select an image from the local disk
  • Click "Insert" or "Upload" and then "Insert"
  1. Navigate to the image and "Settings" tab
  • Select "Exclude from navigation"
  1. Navigate back to parent item ( Content-Type the image was inserted on )
  • The image should still be shown...

Versions

Plone 5.1.2.1 (5112)
CMF 2.2.12
Zope 2.13.27
Python 2.7.14 (default, Oct 9 2017, 22:27:46) [GCC 4.8.4]
PIL 4.3.0 (Pillow)
@petschki
Copy link
Member

petschki commented Jul 9, 2018

NOTE: this happens every time you edit the image. This is likely due to scale recreation on ObjectEdited event but somehow portal_transform doesn't get the updated scales for the image object?

/cc @davisagli maybe you've got some idea where to fix this?

@petschki petschki changed the title Excluding images inserted in TinyMCE breaks content Editing images after inserted in TinyMCE breaks content Jul 9, 2018
@petschki
Copy link
Member

after some digging on this, the underlying problem is, that plone.app.textfield caches the whole transformed output https://github.com/plone/plone.app.textfield/blob/master/plone/app/textfield/transform.py#L44 ... so the generated urls from plone.scale are outdated if you edit the referenced image afterwards. I'll create a pull request there today to fix this issue ...

@petschki
Copy link
Member

fixed by plone/plone.app.textfield#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants