Project

General

Profile

Actions

Bug #86240

closed

rte link wizard selected class is not set if multiple classes

Added by Marco von Arx over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2018-09-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
ckeditor, wizard, rte
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

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 1 (0 open1 closed)

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

Actions
Actions

Also available in: Atom PDF