Project

General

Profile

Actions

Bug #49036

closed

Allow custom active tabs in RTE element browser

Added by Alexander Stehlik almost 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2013-06-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

At the moment the RTE offers hooks to render custom tabs in the element browser (\TYPO3\CMS\Rtehtmlarear).

But even if the a hook in \*TYPO3\CMS\Recordlist\Browser\ElementBrowser::parseCurUrl()* sets a value for "act" it will be overwritten to "url" if the "data-htmlarea-external" flag is TRUE.

A simple solution would be to introduce an additional flag that prevents overwriting the "act" value.

I'll provide a patch to make the problem more clear.

Actions #1

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21346

Actions #2

Updated by Gerrit Code Review almost 11 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21347

Actions #3

Updated by Alexander Stehlik almost 11 years ago

Please look at https://review.typo3.org/21346 for reviewing.

The second patch belongs to I different issue. I mixed up the numbers in the commit message :(

Actions #4

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/21346

Actions #5

Updated by Gerrit Code Review about 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/21346

Actions #6

Updated by Stanislas Rolland about 10 years ago

Alexander Stehlik wrote:

At the moment the RTE offers hooks to render custom tabs in the element browser (\TYPO3\CMS\Rtehtmlarear).

But even if the a hook in \*TYPO3\CMS\Recordlist\Browser\ElementBrowser::parseCurUrl()* sets a value for "act" it will be overwritten to "url" if the "data-htmlarea-external" flag is TRUE.

parseCurUrl() is NOT always able to detect that the url is considered external, in particular in multi-domain setups. Therefore the attribute data-htmlarea-external is set whenever the link is set using the "External url" tab. If such link is to be edited, the active tab must necessarily be "External url", don't you think?

Actions #7

Updated by Gerrit Code Review about 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/21346

Actions #8

Updated by Gerrit Code Review about 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/21346

Actions #9

Updated by Gerrit Code Review about 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/21346

Actions #10

Updated by Alexander Stehlik about 10 years ago

This issue can be closed. The problem was caused by an invalid use of the "data-htmlarea-external" attribute.

When custom links are used this attribute must not be set, otherwise the system thinks the link is external.

There are two places where you need to take care that the attribute is not set:

  1. The JavaScript code that inserts the link. You can use link_spec() because it will remove the "data-htmlarea-external" attribute
  2. Additionally you need to hook into the RteHtmlParser ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['modifyParams_LinksRte_PostProc']) to make sure that the attribute is not re-inserted when the data is loaded into the RTE

For an example implementation of the hook you can have a look at https://github.com/Intera/typo3-extension-linkhandler/commit/41d29fdf30e46fa6d101af232fd1c51a9b8cda30

EDIT: You actually can use link_spec().

Actions #11

Updated by Gerrit Code Review about 10 years ago

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/27680

Actions #12

Updated by Alexander Stehlik about 10 years ago

Finally tracked down a bug that caused the problems in the first place.

Please change the tracker to "bug".

parse_url() will return "record" as scheme for linkhandler links and RteHtmlParser::TS_links_rte() will than treat the link as external even if it is an internal link.

Please see the new changeset for a possible fix: https://review.typo3.org/27680

Actions #13

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27680

Actions #14

Updated by Francois Suter about 10 years ago

  • Tracker changed from Feature to Bug
Actions #15

Updated by Gerrit Code Review almost 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27680

Actions #16

Updated by Gerrit Code Review almost 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27680

Actions #17

Updated by Gerrit Code Review almost 10 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30975

Actions #18

Updated by Gerrit Code Review almost 10 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30976

Actions #19

Updated by Alexander Stehlik almost 10 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF