Bug #75804
closedBug #71298: Fix missing/broken RTE features after Link Handler API merge
RTE.classesAnchor.[ id-string ].titleText is not applied correctly
0%
Description
TEST 1:
in page-tsConfig set:
RTE.classesAnchor.internalLink.titleText = Title internalLink
in BE add a new link in RTE.
=> A new window "insert Link" pops up.
- Tab "page" Title is correctly filled with "Title internalLink"
- switch to any other tab
- titles are incorrect: "Title internalLink"
TEST 2:
in page-tsConfig set:
RTE.classesAnchor.internalLink.titleText >
RTE.classesAnchor.externalLinkInNewWindow.titleText = Title externalLinkInNewWindow
RTE.classesAnchor.download.titleText = Title download
in BE add a new link in RTE.
- Tab "page": Title is empty - correct
- klick tab "external Url": Title is "Title externalLinkInNewWindow" - correct
- klick tab "file": Title is "Title externalLinkInNewWindow" - incorrect
- klick tab "page": Title is now "Title externalLinkInNewWindow" - incorrect
Conclusion:
I seems that the first non-empty value is taken to fill the field "title" and that switching tab is simply ignored.
I assume it's a javascript-bug.
Files
Updated by Wouter Wolters over 8 years ago
- Status changed from New to Needs Feedback
Which exact TYPO3 version do you use?
Updated by Wouter Wolters over 8 years ago
Please try 7.6.5 (which is a security release)
Updated by Markus Klein over 8 years ago
- Assignee changed from Mathias Schreiber to Markus Klein
- Parent task deleted (
#69617) - Sprint Focus set to Remote Sprint
Updated by Markus Klein over 8 years ago
- Status changed from Needs Feedback to New
Updated by Markus Klein over 8 years ago
- Status changed from New to Accepted
- Complexity set to medium
- Is Regression changed from No to Yes
Has to do with todo in typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js:33
Updated by Jorgen van der Kroon over 8 years ago
The names of the forms are changed between TYPO3 version 6 and 7. In changed the javascript file rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js
RteLinkBrowser.changeClassSelector = function() { if (document.lclassform.lclass) { document.lclassform.lclass.value = document.lclassform.lclass.options[document.lclassform.lclass.selectedIndex].value; if (document.lclassform.lclass.value && RteLinkBrowser.HTMLArea.classesAnchorSetup) { for (var i = RteLinkBrowser.HTMLArea.classesAnchorSetup.length; --i >= 0;) { var anchorClass = RteLinkBrowser.HTMLArea.classesAnchorSetup[i]; if (anchorClass['name'] === document.lclassform.lclass.value) { if (anchorClass['titleText'] && document.ltitleform.ltitle) { document.ltitleform.ltitle.value = anchorClass['titleText']; document.getElementById('rtehtmlarea-browse-links-title-readonly').innerHTML = anchorClass['titleText']; } if (typeof anchorClass['target'] !== 'undefined') { if (document.ltargetform.ltarget) { document.ltargetform.ltarget.value = anchorClass['target']; } } else if (document.ltargetform.ltarget && document.getElementById('ltargetrow').style.display === 'none') { // Reset target to default if field is not displayed and class has no configured target document.ltargetform.ltarget.value = RteLinkBrowser.defaultLinkTarget; } break; } } } } };
Now the style selector works.
Updated by Gerrit Code Review over 8 years ago
- Status changed from Accepted 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/48693
Updated by Gerrit Code Review over 8 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48714
Updated by Jorgen van der Kroon over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2a308987bc2aa3e4040c2fd953a4dce030aa8662.
Updated by Andreas Lau about 8 years ago
- File linkTitleBug.png linkTitleBug.png added
- % Done changed from 100 to 0
Hello,
I'm sorry if I open this up again because I didn't make the reight configuration but I have this bug in 7.6.10 (PHP 5.6).
My page-tsConfig is:
RTE.default {
removeTagsAndContents >
proc.allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
buttons.link.properties.class.allowedClasses = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
buttons.link.page.properties.class.default = internal-link
buttons.link.url.properties.class.default = external-link-new-window
buttons.link.file.properties.class.default = download
buttons.link.mail.properties.class.default = mail
}
RTE.classesAnchor {
externalLink {
class = external-link
type = url
titleText = Opens an external site
}
externalLinkInNewWindow {
class = external-link-new-window
type = url
titleText = Opens an external site in a new window
}
internalLink {
class = internal-link
type = page
titleText = Opens an internal site
}
internalLinkInNewWindow {
class = internal-link-new-window
type = page
titleText = Opens an internal site in a new window
}
download {
class = download
type = file
titleText = download a file
}
mail {
class = mail
type = mail
titleText = opens a window to send an e-mail
}
}
When I add a Link in the RTE thie link-title is always "Opens an internal site" but the class is set correctly (see Screenshot).
I think the erreor lies in the file "sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php" lines 504-508:
if ($this->linkAttributeValues['title']) {
$title = $this->linkAttributeValues['title'];
} else {
$title = !$this->classesAnchorDefault[$this->displayedLinkHandlerId] ? '' : $this->classesAnchorDefaultTitle[$this->displayedLinkHandlerId];
}
After those line $title is always "Opens an internal site". When i add the following line afterwards:
$title=$this->classesAnchorDefaultTitle[$this->displayedLinkHandlerId];
it works as expected changing the titles.
Updated by Markus Klein about 8 years ago
@Andreas Otto †: Please open a new ticket and assign me and set a relation to this one after creating it.
Please consider using proper syntax highlighting (pre tag) for code. Thanks.
Updated by Frank no-lastname-given almost 8 years ago
Not working with 7.6.9, php 5.5.26 ?
I applied 48714 to two different installs of Typo3 7.6.9 and it does not change a thing.
Is something else needed?
Urgent thanks.
Updated by Frank no-lastname-given almost 8 years ago
Tested on 7.6.14 out of the box, not working:
Does 7.6.14 need this patch?
Do i have to apply it there, too?
Do i have to apply something else?
Updated by Nando Bosshart almost 8 years ago
having the same problem / behaviour using 7.6.13 / 7.6.14 - this should be really fixed since Editors don't care about this and assigning titleText should work out of the box!
Updated by Markus Klein almost 8 years ago
Please STOP posting to this issue, as noted by me 3 months ago. Please read the comments before posting to a ticket!
Maybe related to #78971