Bug #86240

rte link wizard selected class is not set if multiple classes

Added by Marco von Arx 7 months ago. Updated 2 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
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:
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

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

History

#1 Updated by Marco von Arx 7 months ago

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

#2 Updated by Susanne Moog 6 months ago

  • Sprint Focus set to On Location Sprint

#3 Updated by Riccardo De Contardi 2 days ago

  • Category set to RTE (rtehtmlarea + ckeditor)

#4 Updated by Riccardo De Contardi 2 days 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.

Also available in: Atom PDF