Project

General

Profile

Actions

Bug #75804

closed

Bug #71298: Fix missing/broken RTE features after Link Handler API merge

RTE.classesAnchor.[ id-string ].titleText is not applied correctly

Added by Nicolai Schirawski about 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2016-04-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:
Remote Sprint

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

linkTitleBug.png (8.44 KB) linkTitleBug.png Andreas Lau, 2016-09-06 10:58

Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #78971: Link Wizard keeps title default value so the kind of link changesNewMarkus Klein2016-12-13

Actions
Actions #1

Updated by Wouter Wolters about 8 years ago

  • Status changed from New to Needs Feedback

Which exact TYPO3 version do you use?

Actions #2

Updated by Nicolai Schirawski about 8 years ago

I tested it on 7.6.2

Actions #3

Updated by Wouter Wolters about 8 years ago

Please try 7.6.5 (which is a security release)

Actions #4

Updated by Nicolai Schirawski about 8 years ago

Same behavior with typo3 7.6.5

Actions #5

Updated by Christian Kuhn about 8 years ago

  • Parent task set to #69617
Actions #6

Updated by Markus Klein about 8 years ago

  • Assignee changed from Mathias Schreiber to Markus Klein
  • Parent task deleted (#69617)
  • Sprint Focus set to Remote Sprint
Actions #7

Updated by Markus Klein about 8 years ago

  • Status changed from Needs Feedback to New
Actions #8

Updated by Markus Klein almost 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

Actions #9

Updated by Jorgen van der Kroon almost 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.

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Markus Klein almost 8 years ago

  • Parent task set to #71298
Actions #12

Updated by Gerrit Code Review almost 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

Actions #13

Updated by Jorgen van der Kroon almost 8 years ago

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

Updated by Andreas Lau over 7 years ago

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.

Actions #15

Updated by Markus Klein over 7 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.

Actions #16

Updated by Frank no-lastname-given over 7 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.

Actions #17

Updated by Frank no-lastname-given over 7 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?

Actions #18

Updated by Nando Bosshart over 7 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!

Actions #19

Updated by Markus Klein over 7 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

Actions #20

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF