Bug #89770

Editing a link in ckeditor removes a set CSS class

Added by Andreas Fernandez 13 days ago. Updated 12 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2019-11-25
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

A link being set in ckeditor may have several attriutes set, for example its title, the target and a set of pre-configured CSS classes.

However, editing such link renders the CSS selection with an empty value which removes the previously set class if the link gets updated.

History

#1 Updated by Gerrit Code Review 13 days ago

  • Status changed from In Progress to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62426

#2 Updated by Riccardo De Contardi 12 days ago

I think that these issues are related or even the same:

#83754, #84743, #88710

#3 Updated by Riccardo De Contardi 12 days ago

I am unsure about how to reproduce this issue. May I ask a step-by-step guide? Including the CKeditor yaml configuration that should be used? Thank you!

#4 Updated by Andreas Fernandez 12 days ago

@Riccardo

I've tested this with Bootstrap Package, reproducing it's pretty simple:

  1. Edit any content element that has a ckeditor
  2. Mark some text and put a link on it. In the Link Browser, select a CSS class from the selector and finally set the link
  3. Edit the link again, the previously selected class is not selected anymore

#5 Updated by Riccardo De Contardi 12 days ago

@Andreas

I tried with the yaml configuration taken from Bootstap package:

classesAnchor:
    page:
        class: 'link-page'
        type: 'page'
    folder:
        class: 'link-folder'
        type: 'folder'
    file:
        class: 'link-file'
        type: 'file'
    external:
        class: 'link-external'
        type: 'url'
    mail:
        class: 'link-mail'
        type: 'mail'

buttons:
    link:
        properties:
            class:
                allowedClasses: 'link-arrow, link-page, link-folder, link-file, link-external, link-mail'

And actually, the behavior is the one you described. But I think that it is due to the link-arrow class that has no "type" defined. Actually, if you remove it, then the selected class will stay.

That's the same behavior I experienced with my first attempt:

classesAnchor:
  internalLink:
    class: 'internal-link'
    type: 'page'

  internalLink2:
    class: 'internal-link-2'
    type: 'page'    

buttons:
  link:
    properties:
      class:
        allowedClasses: 'internal-link,internal-link-2'

Also available in: Atom PDF