silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
719 stars 820 forks source link

4.3.0 regression / Image realignment in TinyMCE #8529

Open dnsl48 opened 5 years ago

dnsl48 commented 5 years ago

Affected Version

4.3.0

Description

Cannot change alignment for an image in TinyMCE

Steps to Reproduce

browser: Chromium, Version 70.0.3538.67 (Official Build)

  1. Go to the admin panel: http://ss43test-uat.sites.silverstripe.com/admin/
  2. Log in: admin/password
  3. Open "Files" in the LeftAndMain menu
  4. Press "Upload", upload a JPEG image, publish it
  5. Go to a content page
  6. Add several lines of content
  7. In the text editor press "Insert from Files", pick your image
  8. Set Alignment "Center", Width "400", add random caption text, then press Insert file
  9. Click on the image in the text editor
  10. On the pop-up press "Align left"

You should see both "Left" and "Center" alignment selected

chillu commented 5 years ago

Might be limited to "simple" theme, changes need to get backported from CWP theme. This is part of our demo, so it's important to fix such a basic feature

lukereative commented 5 years ago

I think the reason why tinymce shows both as selected is when we apply a caption we wrap the image and the caption in a div which also gets the alignment class along with the image and the caption as well. There's also an issue that tinymce doesn't remove leftAlone and rightAlone because they are not built in alignment states (unlike 'right', 'center' and 'left')

chillu commented 5 years ago

OK, captioned images are not a common use case, I'm half of a mind to remove that feature in favour of content blocks. Moving this back to Icebox with impact/low, not worth investing much energy into.