Bug #86240
closedrte link wizard selected class is not set if multiple classes
0%
Description
Screenshots: Steps to reproduce:
- Add the following lines to the ckeditor configuration file:
buttons:
link:
properties:
class:
allowedClasses:
- 'btn btn-braun'
- 'btn btn-weiss'
- 'btn btn-phone'
- 'btn btn-mail' - Open Typo3-Backend and create a new link in a content element.
- Select one of the classes in the “Link-Browser” and save.
- Open the link browser again and the previous selected class will not be automatically selected.
after some searching I identified the possible cause in file
TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController line 185ff // Only keep last class value (others are automatically added again by required option) // https://review.typo3.org/#/c/29643 $currentClasses = GeneralUtility::trimExplode(' ', $this->currentLinkParts['class'], true); if (count($currentClasses) > 1) { $this->currentLinkParts['class'] = end($currentClasses); }
if we remove this line the select box is set to right value
Updated by Marco von Arx about 6 years ago
- Related to Feature #51905: Manage multiple classes attribution inside RTE added
Updated by Susanne Moog about 6 years ago
- Sprint Focus set to On Location Sprint
Updated by Riccardo De Contardi over 5 years ago
- Category set to RTE (rtehtmlarea + ckeditor)
Updated by Riccardo De Contardi over 5 years ago
- Status changed from New to Closed
I am not able to reproduce this issue on 8.7.24, 9.5.5 and 10.0.0-dev (latest master);
I followed the following procedure:
1) add to the ckeditor configuration (yaml file) the lines:
buttons: link: properties: class: allowedClasses: - 'btn btn-braun' - 'btn btn-weiss' - 'btn btn-phone' - 'btn btn-mail'
2) Created a content element "Text", write in it some text lines, mark a word, create a link with the button
2.1) select one of the options on the dropdown "CSS class" (e.g. btn btn-phone)
2.2) create the link
2.3) repeat this process for several types of link (page, file, external url, email, phone (only version 10)) using each time a different value from the dropdown
3) Save and close
Results:¶
opening the content element again:
1) when inspecting the source code of the text, both classes are applied to the link
2) after selecting the link and clicking again on the "link button" to edit the link, the CSS Class dropdown still presents the value selected for each link that was defined
3) the value does not change even when you select the different tabs on the link wizard modal (page, file, external url...)
Therefore, I close this issue, as it is IMO resolved.
If you think that this is the wrong decision or experience the issue again, please reopen it or open a new issue with a reference to this one; please also include a detailed description of the steps followed to reproduce the issue.
Thank you.