Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Links for pageids #5

Closed
mmirsch opened this issue Nov 7, 2017 · 13 comments
Closed

Wrong Links for pageids #5

mmirsch opened this issue Nov 7, 2017 · 13 comments
Labels

Comments

@mmirsch
Copy link

mmirsch commented Nov 7, 2017

When using pageIdSelector to enter TYPO3 page-ids directly, the generated links are not working any more.

I fixed this by entering these lines in "rtehtmlarea\Resources\Public\JavaScript\RteLinkBrowser.js":

    if (parseInt(input) == input) {
        input = 't3://page?uid=' + input;
    }

Here my Patch:

--- /typo3conf/ext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js (revision )
+++ /typo3conf/ext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js (revision )
@@ -96,6 +96,11 @@
delete attributes.target;
delete attributes.params;

+ // replace links from PageIdInputField
+ if (parseInt(input) == input) {
+ input = 't3://page?uid=' + input;
+ }
+
RteLinkBrowser.plugin.createLink(
input + curParams,
curTarget,

@liayn liayn added the question label Mar 24, 2020
@liayn
Copy link
Member

liayn commented Mar 24, 2020

Which TYPO3 version are you using?

@mmirsch
Copy link
Author

mmirsch commented Mar 25, 2020

I am not sure, maybe TYPO3 7.6

@liayn
Copy link
Member

liayn commented Mar 25, 2020

This is rather strange then, because the t3://page syntax came with TYPO3 version 8.3

@mmirsch
Copy link
Author

mmirsch commented Mar 25, 2020

Ok, I found it.
It was in TYPO3-extension rtehtmlarea-8.7.0.

@liayn
Copy link
Member

liayn commented Apr 3, 2020

I released version 8.7.3 today. can you please verify if this is still a problem in the latest version?

@mmirsch
Copy link
Author

mmirsch commented Apr 3, 2020

The problem still exista, as you didn't change the javascript file.

Here the patch again:

Index: www.local.typo3.org/typo3conf/ext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8

--- www.local.typo3.org/typo3conf/ext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js (date 1585910886209)
+++ www.local.typo3.org/typo3conf/ext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js (date 1585910886209)
@@ -96,6 +96,10 @@
delete attributes.target;
delete attributes.params;

  •    if (parseInt(input) == input) {
    
  •        input = 't3://page?uid=' + input;
    
  •    }
    
  •    RteLinkBrowser.plugin.createLink(
           input + curParams,
           curTarget,
    

@liayn
Copy link
Member

liayn commented Apr 3, 2020

@mmirsch Thanks for the info. Would you mind creating a Pull-Request instead of posting it inline in the comments?

@liayn liayn added bug and removed question labels Apr 3, 2020
@mmirsch
Copy link
Author

mmirsch commented Apr 3, 2020

Ok, how do I do that?

@mmirsch
Copy link
Author

mmirsch commented Apr 3, 2020

Ok, found a way to do the pull request abd I hope I did it correctly.

@liayn
Copy link
Member

liayn commented Apr 3, 2020

Do you see the same problem if you set such a link in normal link field (e.g. header link)?

@mmirsch
Copy link
Author

mmirsch commented Apr 3, 2020

I cannot even activate this in TYPO3 8.7.
Do you know, if it's possible an how?
i tried:

TCEMAIN.linkHandler.page {
configuration {
pageIdSelector.enabled = 1
}
}

In page tsconfig, but when I checked source code I found that this option is only working for recordlists.

@liayn
Copy link
Member

liayn commented Apr 3, 2020

You are right. I looked up the code now too and this feature is indeed RTE-only.

Your fix is working as expected, but actually I consider this a core-bug, which needs to be fixed for any RTE. The appropriate place would be this:
https://github.com/TYPO3/TYPO3.CMS/blob/master/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/PageLinkHandler.ts#L53

I'll create a patch for core, but since v8 is already in ELTS mode, I can't guarantee this will still be fixed for v8.

@liayn
Copy link
Member

liayn commented Apr 3, 2020

Will continue in https://forge.typo3.org/issues/82942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants