Bug #19957
closedlinkHandler different than "record" leads to rteerror
0%
Description
class.tslib_content.php->typoLink($linktxt, $conf)
provides an hook for an linkHandler.
So an typolink like:
<link commerce:tx_commerce_products:66|tx_commerce_categories:5 -
internal-link>LinkText</link>
is valid.
But if i do it in an rte field, i get:
<span style="border: 2px solid red; background-color: yellow; color: black;"><link commerce:tx_commerce_products:66|tx_commerce_categories:5 -</p> <p>internal-link>LinkText</link></span>
Because in
typo3_src/t3lib/class.t3lib_parsehtml_proc.php->TS_links_rte($value)
there is only "record:" allowed.
Reproduce:
create text content element, disable rte and put this snippet into it:
<link commerce:tx_commerce_products:66|tx_commerce_categories:5 -
internal-link>LinkText</link>
save - everything will be fine.
Activate rte - you will see the error, deactivate the rte you get:
<span style="border: 2px solid red; background-color: yellow; color: black;"><link commerce:tx_commerce_products:66|tx_commerce_categories:5 -</p> <p>internal-link>LinkText</link></span>
You do not need to install an Extension or select something from the RTE do prove that.
(issue imported from #M10331)
Files
Updated by Martin Holtz almost 16 years ago
i added an modified
T3X_linkhandler-0_2_1-z-200902031052.t3x
where i simple added an second linkhandler in
ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler']['commerce'] = 'EXT:linkhandler/class.tx_linkhandler_handler.php:&tx_linkhandler_handler';
Updated by Martin Holtz almost 16 years ago
Test this issue:
1.) Install linkhandler extension.
2.) create content element, disable rte and put into
<link commerce:tx_commerce_products:66|tx_commerce_categories:5>LinkText</link>
3.) save content element, enable rte and save again. Disable rte again, you will get:
<span style="border: 2px solid red; background-color: yellow; color: black;"><link commerce:tx_commerce_products:66|tx_commerce_categories:5 -
internal-link>LinkText</link></span>
4.) apply patch. Do Step 1-3 you should not get the span again
5.) test than
<link somedifferent:tx_commerce_products:66|tx_commerce_categories:5>LinkText</link>
should be wrapped in Error: <span ...> again
Updated by Daniel Poetzinger almost 16 years ago
Possibly not what you wanted to hear :-) but. You could use the "linkhandler" extension - and propably can configure a TAB "commerce" where you can link to the products?
Updated by Sascha Egerer almost 16 years ago
@ Daniel
in commerce there is a CategoryTree with the products. This is why there is a own "linkhandler" added.
It would be cool if this patch would be added to core
Updated by Martin Holtz over 15 years ago
@Daniel Hinderink: yep, thats not what i want to hear.
The question for me is not, if your extension "linkhandler" works or not, but since such an link definition is valid:
<link commerce:tx_commerce_products:66|tx_commerce_categories:5 -
internal-link>LinkText</link>
It should be possible to use it in RTE without getting an ugly and wrong! warning around it.
So in my eyes there are two solutions:
disallow different custom links like <link commerce
or if they are allowed, it should be possible to render them in RTE (there is a solution... so why not?)
but what we have now is a half solution
Updated by Martin Holtz over 15 years ago
hi,
i added an test-extension "testlinkhandler"
it will register an linkhandler for <link test:10>test</link>
Test like this:
1) create text element - disable RTE
2) insert
<link test:1>Link to page 1</link>
<link unknownlinkhandler:1>This will be marked as error</link>
3) save
4) enable RTE
Only "This will be marked as error" should be market as an error.