Bug #44440

Setting an external link with domain of the backend leads to exception

Added by Helmut Hummel over 9 years ago. Updated almost 4 years ago.

Should have
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Asuming the website is running on http://domain.tld and the user is logged into the backend on the same domain. When now putting a link as external URL in the link picker e.g. http://domain.tld/en/home.html
rte cuts off the domain when saving the element. Now the element is not editable any more
because during loading, the URL en/home.html is considered to be a file
which leads to an Exception


The question now is: how to deal with that?


44440.patch (1.01 KB) 44440.patch Marc Bastian Heinrichs, 2013-02-19 19:50

Related issues

Related to TYPO3 Core - Bug #45490: Problem with blank spaces in data/folder namesClosed2013-02-14

Related to TYPO3 Core - Bug #46785: FileDoesNotExistException ClosedAlexander Opitz2013-03-29


Updated by Helmut Hummel over 9 years ago

  • Status changed from New to Accepted

Updated by Steffen Liebig over 9 years ago

I noticed a similar bug - don't know if it's the same one but looks comparable:

First of all, I had problems trying to edit text elements via Page/List. I got "Oops, an error occured" without any explanation. Enabling BE/Debug and changing ProductionExceptionHandler to DebugExceptionHandler (display errors -1 -> 1) threw errors in a few php-files:

TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException thrown in file

/home/www/typo3/typo3/sysext/core/Classes/Resource/Driver/AbstractDriver.php in line 399

together with problems in RTE, FormEngine.php, EditDocumentController.php and alt_doc.php.

Disabling the RTE made it possible to take a look at the code. Correcting the links (deleting the numbers which were given to the file names while moving the site from 4.7.2 to 6.0.0/6.0.1) made it possible to reach the element via RTE again, BUT:

- other subpages throw similar mistakes...checking the code showed that the links are ok in the BE while in FE (mouseover), they get cut off seemingly ALL AT THE SAME POINT. It seemed to be a blank space in the data name causing the trouble, but thats not the crucial point. I replaced it by "_" in the links and in the name of the data folder without success: it lead to the same mistake AFTER the "_"

Assuming: it doesn't seem to matter whether I add the "_" or not - the mistake stays the same, the links are cut off somewhere between BE (RTE ?!) and FE which means they aren't usable anymore.

I just can join Helmut's question: "How to deal with it ?"


Updated by Marc Bastian Heinrichs over 9 years ago

Fixed this for now with attached patch


Updated by Henrik Ziegenhain over 9 years ago

There’s a simular issue with blank spaces in filenames/foldernames in #46007.
The patch from Marc Bastian Heinrichs solves my problem. Thanks.

Could we get this into 6.0.3?


Updated by Thomas Allmer over 9 years ago

Problem still persists in 6.0.4 and won't let you insert any links (to the current domain) in any RTE field... even if you edit it in the DB...
and you can't fix or remove the link as when opening the CE it throws the error...


Updated by Henrik Ziegenhain over 9 years ago

As mentioned above, the patch from Marc Bastian Heinrichs solved the issue.

Marc, could you push this to gerrit or how could we get this fixed?


Updated by Thomas Allmer over 9 years ago

thx Marc :)
Patch works just fine :)

I now have it in my Extension tinymce_rte as I have this function "xclassed" anyway...



Updated by Stanislas Rolland about 9 years ago

I am not able to reproduce this issue.

The RTE transformation does not cut the domain off an url entered in the "External link" tab of the link dialogue of htmlArea RTE.


Updated by Stanislas Rolland about 9 years ago

  • Status changed from Accepted to Needs Feedback

Updated by Henrik Ziegenhain about 9 years ago

It seems, that is has something to do with (wrong) configuration.
I also can`t reproduce the issue from Helmut on a fresh 6.0.4 and 6.0.5rc1

On another Installtion (updated from 4.5.x to 6.0.4) I can reproduce it.


Updated by Henrik Ziegenhain about 9 years ago

After a little more investigation I found the following:

Adding a link via the "External Tab" worked fine after saving.
Pasting the same link simply into the RTE and saving crashed it and throwed the exception from above.

The following worked fine:
Pasting the link simply into the RTE, switching to HTML-Mode and manually adding 'data-htmlarea-external="1"' the to a-tag worked fine after saving.

The Installation was updated from 4.7x to 6.0.4 (also reproducable with 6.0.5rc1)

On a fresh and clean installation the data-attribute also is not set, but the exception is not thrown after saving.


Updated by Philipp Müller about 9 years ago

The error occurs also if a text with a link will be copy-pasted from the frontend into the editor.

Patch works fine for me, thanks Marc.

You can reproduce the error, if you add the following code in the editor:

<link dead/link/>linktext</link>

I think the patch is much-needed in 6.0.5... It's not justifiable to provoke a fatal error because a simple "wrong" link in a text editor...


Updated by Gerrit Code Review about 9 years ago

  • Status changed from Needs Feedback to Under Review

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


Updated by Alexander Opitz about 9 years ago

I fixed this in #46785 for 6.1/6.2 there is a FolderDoesNotExistException thrown.
BTW: There are two lines who we need to catch.


Updated by Thomas Allmer about 9 years ago

it seems that AFTER 6.0.4? we now have two different Exceptions FileDoesNotExistException and FolderDoesNotExistException... so we have to catch them both

I did it like this

} catch(\Exception  $e) {
    if ($e instanceof \TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException OR $e instanceof \TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException) {
        // no file or folder - nothing to do
    } else {
        // Rethrow the Exception
        throw $e;

Updated by Mikael Conley about 9 years ago

Still broken in 6.0.6. Does anybody writing this code realize how bad this makes TYPO3 look to our clients?


Updated by Stanislas Rolland almost 9 years ago

  • Status changed from Under Review to Resolved
  • Assignee set to Stanislas Rolland

Was fixed in http://forge.typo3.org/issues/46785

Fix will be included in TYPO3 6.0.7.


Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF