Project

General

Profile

Actions

Bug #82865

closed

Custom link attributes not working on rte_ckeditor

Added by Tania Morales over 6 years ago. Updated 8 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2017-10-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
rte_ckeditor
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Adding the corresponding configuration to page TS config can not work as the configuration array expected is parsed on a different way.

Class BrowseLinksController :
line 137
$this->buttonConfig = $this->thisConfig['buttons']['link'] ?? [];

It only works by appending a dot to the array keys like this:
$this->buttonConfig = $this->thisConfig['buttons.']['link.'] ?? [];

Same for lines 192 and 193

The RTE configuration looks like this

RTE {
default {
classesAnchor {
externalLink {
class = external-link
type = url
titleText = Opent een pagina op een andere website
}
}
buttons {
link {
url.properties.class.default = external-link
properties.class.allowedClasses =external-link
}
}
}

This is a very popular and important feature on the RTE and we have got lots of complains because it was working fine on previous versions. I'd really appreciate any feedback.


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #81381: RTE TSConfig is lost when using own CKEditor presetClosed2017-05-30

Actions
Actions #1

Updated by Frans Saris over 6 years ago

  • Is duplicate of Bug #81381: RTE TSConfig is lost when using own CKEditor preset added
Actions #2

Updated by Frans Saris over 6 years ago

  • Status changed from New to Closed

Thanks for looking into this. But this is fixed already see #81381 and is be part of lastest release. Did you try this one with the last released version 8.7.8?

Actions #3

Updated by Tania Morales over 6 years ago

Thanks for the feedback Frans, but I can confirm that the issue is not solved and it can be reproduced on 8.7.8

See may description above please, the only way to make the configuration from page TSconfig work is by adding the dots to the array keys. Which were removed on change set
ca643e75068732a35ca98b180bc7399d53bb1d55 according to bug report https://forge.typo3.org/issues/81381

Actions #4

Updated by Frans Saris over 6 years ago

So we are talking about the same change. Looks like it brought us a regression sadly :(

But that is strange as the tsconfig override didn't work at all before that change.

Your example ts only worked in TYPO3 7 and before or also in the first 8.7 version?

Actions #5

Updated by Tania Morales over 6 years ago

Hi Frans, the example configuration works on 8.7.7, even though is a little buggy.
On 8.7.7 the array keys do have the dot.

When I say buggy is because the link titles values sometimes get scrambled on the link browser forms. I.e the email title value is shown on the internal page title field, and etc . But I think that is related to a JS issue.

Actions #6

Updated by Frans Saris over 6 years ago

Are you using CKEditor or the old rte?

Actions #7

Updated by Philipp Müller over 6 years ago

I can confirm this issue in 8.7.8 with rte_ckeditor. With my yaml-configuration the class-selector is lost completely.

classesAnchor.:

  externalLink.:
    class: 'external-link'
    type: 'url'

  downloadLink:
    class: 'download-link'
    type: 'file'

  mailLink:
    class: 'mail-link'
    type: 'mail'

buttons.:
  link.:
    properties.:
      class.:
        allowedClasses: 'external-link,download-link,mail-link'
Actions #8

Updated by Frans Saris over 6 years ago

Hi Philipp,

that your yaml doesn't work anymore is correct as it uses a non supported format (the . after every key) that was fixed with #81381. Adding the dots was a workaround to get it working in previous versions.

Frans

Actions #9

Updated by Tania Morales over 6 years ago

Frans Saris wrote:

Are you using CKEditor or the old rte?

Yes, as described on the title of this bug report, the problem occurs on rte_ckeditor from the core.

Actions #10

Updated by Frans Saris over 6 years ago

The whole RTE configuration shifted from pageTS to YAML.

So you need to create your own YAML configuration for some more insides see https://www.slideshare.net/FransSaris/htmlarea-to-ckeditor-creates-presets-and-your-own-plugin

An example of a custom YAML with these settings:

own preset

# Load default processing options
imports:
    - { resource: "EXT:rte_ckeditor/Configuration/RTE/Default.yaml" }

classesAnchor:

  externalLink:
    class: 'external-link'
    type: 'url'

  downloadLink:
    class: 'download-link'
    type: 'file'

  mailLink:
    class: 'mail-link'
    type: 'mail'

buttons:
  link:
    properties:
      class:
        allowedClasses: 'external-link,download-link,mail-link'

Editor options can still be overwritten by pageTS see #81880

So currently the options classesAnchor, blindLinkOptions, blindLinkFields, buttons.link and classes can not be overwritten from pageTS. Will discus this with the rest of the team to see if this is wanted behavior or a bug.

Actions #11

Updated by Frans Saris over 6 years ago

  • Status changed from Closed to In Progress
Actions #12

Updated by Gerrit Code Review over 6 years ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #13

Updated by Frans Saris over 6 years ago

  • Is Regression set to Yes
Actions #14

Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #15

Updated by Tania Morales over 6 years ago

  • Subject changed from Custom link attributes now working on rte_ckeditor to Custom link attributes not working on rte_ckeditor
Actions #16

Updated by Gerrit Code Review over 6 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #17

Updated by Gerrit Code Review over 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #18

Updated by Gerrit Code Review over 6 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #19

Updated by Gerrit Code Review over 6 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #20

Updated by Gerrit Code Review over 6 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54511

Actions #21

Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54665

Actions #22

Updated by Frans Saris over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #23

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54665

Actions #24

Updated by Gerrit Code Review over 6 years ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54665

Actions #25

Updated by Frans Saris over 6 years ago

  • Status changed from Under Review to Resolved
Actions #26

Updated by Anonymous about 6 years ago

TSConfig like this is working up to TYPO3 8.7.7 - on 8.7.8 its not working anymore!

RTE.default{
preset = al_custom
classesAnchor {
url {
class = link external
type = url
titleText = Opens external link in new window
target = _blank
image =
}
page {
class = link
type = page
titleText = Opens internal link in this window
target = _top
image =
}
file {
class = link download
type = file
titleText = external file
target = _blank
image =
}
folder >
mail {
class = link mail
type = mail
titleText = Email Address
image =
}
}
buttons.link{
page.properties.class.default = link
url.properties.class.default = link external
folder >
file.properties.class.default = link download
mail.properties.class.default = lunk email
properties.class.allowedClasses = link,link external,link email,link download
}
}

Is this by design?? I hope its not! So if its a breaking change it should be at least documented, but hten it had to be shifted latest with 8.7.0!!!
Cant find it here: https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.7/Index.html#breaking-changes
Greetings!

Actions #27

Updated by Frans Saris about 6 years ago

This is fixed in the next release

Actions #28

Updated by Anonymous about 6 years ago

Hi Frans, I did not wrote your commend "Will discus this with the rest of the team to see if this is wanted behavior or a bug." - so I prefer its a bug ;-)
Ok if its fixed in next release its perfect. (and I will not create a new bugreport for this :-) )
Thnx!

Are such breaking bugs documented somerwhere - or is the only way to search the bugtracker?
And the TSConfig stuff for this should be marked as deprecadet for it will be removed in 9?

Actions #29

Updated by Emile Blume about 6 years ago

The titleText value in the backend does not seem to work either correctly. Once set it is passed over to the next tabs. So, 'Opens a link in the website' is also showed in the tab for External URL and so forth. For now I'm not using predefined titles but it should work by default.

Actions #30

Updated by Mordamir almost 6 years ago

Philipp Müller wrote:

I can confirm this issue in 8.7.8 with rte_ckeditor. With my yaml-configuration the class-selector is lost completely.

[...]

Any news on this? I tries with 8.7.13 and this is still not working, so i need to switch back to 8.7.7

Actions #31

Updated by Loon Buster over 5 years ago

..nothing is "done"; what a mess.

who makes this up?!! in a system with its own configuration language (tsc) add another module which is based on a new one (yaml)? the old rte was a already a mess - but at least for that there were workarrounds! there is no explanation how it goes beyond this standard setup - for example:

editor
- disable the annoying wrapping at html tags where it makes no sense (images f.e.) > allowTagsOutside still not working

link browser
- how to remove single riders?
- how can I assign the individual link states: all the same class and additionally assign different classes?
- change the "Allowed media providers" / "Upload Path" (i know there's an hook..)

why do you remove what somehow worked and replace it with something that is rather limited. are you relying on everyone likes beta versions?

.loon

Actions #32

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #33

Updated by Emile Blume over 3 years ago

  • TYPO3 Version changed from 8 to 10
  • PHP Version changed from 7.1 to 7.2

I'm currently looking into some issues for a v10.4 upgrade and noticed that the titleText still isn't working. Has this option been removed or was it never supposed to be used?

classesAnchor:

internalLink:
class: 'internal-link'
type: 'page'
titleText: 'Opent een pagina binnen deze website'
Actions #34

Updated by Stephan Großberndt 8 months ago

  • Assignee deleted (Gerrit Code Review)
Actions #35

Updated by Stephan Großberndt 8 months ago

  • TYPO3 Version changed from 10 to 8
  • PHP Version changed from 7.2 to 7.1

@Emile Blume Please create a new issue if this is still valid.

Actions

Also available in: Atom PDF