Bug #86240

rte link wizard selected class is not set if multiple classes

Added by Marco von Arx 6 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-09-13
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
Tags:
ckeditor, wizard, rte
Complexity:
Is Regression:
Sprint Focus:

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:
  1. 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'
  2. Open Typo3-Backend and create a new link in a content element.
  3. Select one of the classes in the “Link-Browser” and save.
  4. 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


Related issues

Related to TYPO3 Core - Feature #51905: Manage multiple classes attribution inside RTE Closed 2013-09-11

History

#1 Updated by Marco von Arx 6 days ago

  • Related to Feature #51905: Manage multiple classes attribution inside RTE added

Also available in: Atom PDF