Bug #89770
closedEditing a link in ckeditor removes a set CSS class
0%
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.
Updated by Gerrit Code Review almost 5 years 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
Updated by Riccardo De Contardi almost 5 years ago
Updated by Riccardo De Contardi almost 5 years 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!
Updated by Andreas Kienast almost 5 years ago
@Riccardo
I've tested this with Bootstrap Package, reproducing it's pretty simple:
- Edit any content element that has a ckeditor
- 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
- Edit the link again, the previously selected class is not selected anymore
Updated by Riccardo De Contardi almost 5 years ago
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'
Updated by Markus Klein almost 5 years ago
I agree with Riccardo here, configuration error.
Updated by Andreas Kienast almost 5 years ago
- Status changed from Under Review to Rejected