Bug #75804

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 3 years ago. Updated 8 months ago.

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

0%

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.

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


Related issues

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

Associated revisions

Revision 2a308987 (diff)
Added by Jorgen van der Kroon almost 3 years ago

[BUGFIX] Correctly apply titleText set in RTE TSconfig

With the changes of the new formEngine the names of forms and
elements must be adjusted to make the Page TSconfig options
RTE.classesAnchor.[id].titleText work again.

Resolves: #75804
Releases: master, 7.6
Change-Id: I92b2c6d0dcb959834db3bb8868beab55b627abac
Reviewed-on: https://review.typo3.org/48693
Tested-by: Bamboo TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 9fcc0c1a (diff)
Added by Jorgen van der Kroon almost 3 years ago

[BUGFIX] Correctly apply titleText set in RTE TSconfig

With the changes of the new formEngine the names of forms and
elements must be adjusted to make the Page TSconfig options
RTE.classesAnchor.[id].titleText work again.

Resolves: #75804
Releases: master, 7.6
Change-Id: I92b2c6d0dcb959834db3bb8868beab55b627abac
Reviewed-on: https://review.typo3.org/48714
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Wouter Wolters about 3 years ago

  • Status changed from New to Needs Feedback

Which exact TYPO3 version do you use?

#2 Updated by Nicolai Schirawski about 3 years ago

I tested it on 7.6.2

#3 Updated by Wouter Wolters about 3 years ago

Please try 7.6.5 (which is a security release)

#4 Updated by Nicolai Schirawski about 3 years ago

Same behavior with typo3 7.6.5

#5 Updated by Christian Kuhn about 3 years ago

  • Parent task set to #69617

#6 Updated by Markus Klein about 3 years ago

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

#7 Updated by Markus Klein about 3 years ago

  • Status changed from Needs Feedback to New

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

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

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

#11 Updated by Markus Klein almost 3 years ago

  • Parent task set to #71298

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

#13 Updated by Jorgen van der Kroon almost 3 years ago

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

#14 Updated by Andreas Lau over 2 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.

#15 Updated by Markus Klein over 2 years ago

@Andreas: 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.

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

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

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

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

#20 Updated by Benni Mack 8 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF