Bug #83754

Unable to set preconfigured values in CKEditor for title and target

Added by Michael Straschek about 2 years ago. Updated 3 months ago.

Status:
Needs Feedback
Priority:
-- undefined --
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2018-02-01
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In TYPO3 8.7.9, it is not possible to set custom values for title and target in the link browser, except for the first iframe (in my case "page").

Reason: After opening the link browser ant then clicking a tab (e.g. "file") the current form values of target & title are sent via _GET.
In both getTitleField() & getTargetField() those values (stored in $this->linkAttributeValues) will override the preconfigured values:

\TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController::getTitleField

if ($this->linkAttributeValues['title']) {
  $title = $this->linkAttributeValues['title'];
} else {
  $title = $this->classesAnchorDefaultTitle[$this->displayedLinkHandlerId] ?: '';
}

\TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController::getTargetField

$target = $this->linkAttributeValues['target'] ?: $this->defaultLinkTarget;

TSconfig:

RTE.classesAnchor {
  internalLink {
    class = anchor anchor--internal
    type = page
    titleText = Title for internalLink
  }

  downloadLink {
    class = anchor anchor--download
    type = file
    target = _blank
    titleText = Title for downloadLink
  }

  externalLink {
    class = anchor anchor--external
    type = url
    target = _blank
    titleText = Title for externalLink
  }

  externalDownloadLink {
    class = anchor anchor--download
    type = url
    target = _blank
    titleText = Title for externalDownloadLink
  }

  mailLink {
    class = anchor anchor--mail
    type = mail
    titleText = Title for mailLink
  }
}


Related issues

Related to TYPO3 Core - Bug #86701: Setting different link targets in Link Browser does not work properly Closed 2018-10-19
Related to TYPO3 Core - Feature #87526: LinksController - Override with default on LinkHandler switch New 2019-01-23
Related to TYPO3 Core - Bug #84743: ClassesAnchor target not set (ckeeditor) Closed 2018-04-16
Related to TYPO3 Core - Bug #88710: rte_ckeditor link browser classes and their titleText and target Needs Feedback 2019-07-09

History

#1 Updated by Michael Straschek about 2 years ago

For at least the target field I may limit this issue, as following TSconfig does (half) the job for me:

RTE.default.buttons.link.url.target.default = _blank

Still it would be impossible to sent different default targets for different configurations of same link type (in my examle externalLink and externalDownloadLink for uri), but that may be an edge case...

#2 Updated by Michael Straschek about 2 years ago

  • Project changed from forge.typo3.org to TYPO3 Core
  • Category set to RTE (rtehtmlarea + ckeditor)
  • Priority changed from Should have to -- undefined --
  • TYPO3 Version set to 8
  • PHP Version set to 7.1

#3 Updated by Riccardo De Contardi over 1 year ago

  • Related to Bug #86701: Setting different link targets in Link Browser does not work properly added

#4 Updated by Riccardo De Contardi 12 months ago

  • Related to Feature #87526: LinksController - Override with default on LinkHandler switch added

#5 Updated by Riccardo De Contardi 10 months ago

  • Related to Bug #84743: ClassesAnchor target not set (ckeeditor) added

#6 Updated by Markus Klein 3 months ago

  • Status changed from New to Needs Feedback

This behaviour is intended. The machine should not remove text that has been entered by the user.
Replacing it with a default value is something I would consider really bad UX.

#7 Updated by Markus Klein 3 months ago

  • Related to Bug #88710: rte_ckeditor link browser classes and their titleText and target added

Also available in: Atom PDF