#86240rte link wizard selected class is not set if multiple classes
Description
If in the ckeditor configuration file a class is added to the selectbox in the “link browser”, which contains more than one class, it will not be automatically selected in the “link browser”.
Screenshots: Steps to reproduce:
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
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.