Project

General

Profile

Actions

Bug #57395

closed

Images in folders with special chars not working

Added by Einar Gislason over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Won't have this time
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-03-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Images created in folders with special characters are not showing in FE, though they are showing fine in BE.

#1314516810: File /pages/2013/Tips_og_r%C3%A5d/Screen_Shot_2014-03-25_at_17.58.59_09.png/ does not exist.

We have these settings enabled:
[SYS][UTF8filesystem] = 1
[SYS][systemLocale] = da_DK.UTF-8

The folders themselves have danish latin1 character in them. Remove those and the images show up without a problem.

The TYPO3 Exception is attached as an html file.


Files

TYPO3_Exception.html (85.2 KB) TYPO3_Exception.html Einar Gislason, 2014-03-27 16:09
Screen_Shot_2014-04-01_at_09.58.21.png (96.3 KB) Screen_Shot_2014-04-01_at_09.58.21.png Einar Gislason, 2014-04-01 10:01
Actions #1

Updated by Markus Klein over 10 years ago

Where does the path come from? Is it stored in a database record? What's the TCA of this DB field?

Actions #2

Updated by Einar Gislason over 10 years ago

Markus Klein wrote:

Where does the path come from? Is it stored in a database record? What's the TCA of this DB field?

The path comes from the field "identifier" in table "sys_file" and looks like this:
/pages/2013/Tips_og_råd/Screen_Shot_2014-03-25_at_17.58.59_09.png
This path is correct and returns an image if I paste it into a browser

The TCA is created using ExtensionManagementUtility::getFileFieldTCAConfig on the field

'tx_boliusproducts_teaserimage' => array(
        'exclude' => 1,
        'label'   => $locallang_db . 'tx_boliusproducts_domain_model_product.tx_boliusproducts_teaserimage',
        'config'  => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('tx_boliusproducts_teaserimage')
    ),

The field itself is of type TEXT in the db.

Actions #3

Updated by Einar Gislason over 10 years ago

Here is an exampe:
This will work:
<f:image src="fileadmin/Folder_øæå/Screen_Shot_2014-04-02_at_11.29.27.png" />
This will return an error:
<f:image src="fileadmin/pages/2014/%C3%A6l%C3%A5_%C3%A5%C3%A6%C3%A6_%C3%85/Screen_Shot_2014-04-02_at_11.32.46_01.png" />

The second path is created using the FILES cObject in Typoscript (not the same exact image, but you get the point):

something = FILES
something {
  references {
    table = pages
    uid.current = 1
    fieldName = tx_boliusproducts_teaserimage
  }
  renderObj = TEXT
  renderObj{
    data = file:current:publicUrl
  }
}

Having dug through the core classes I have out that publicUrl originates here TYPO3\CMS\Core\Resource\Driver\LocalDriver. The function getPublicUrl takes an identifier and returns a string.
In the process the identifier gets rawurlencoded which results in a string that looks like the one above.

So the question is: Is the folder name supposed to be rawurlencoded? And if so, shouldn't Fluid be able to render an image from a resource-uri like the one above?
If not, then creating folders with special characters shouldn't be possible at all.

Actions #4

Updated by Einar Gislason over 10 years ago

Having discussed the issue with Steffen Ritter the conclusion seems to be that publicUrl should not be used when generating images like this.
A "correct" example would/could be:

Typoscript:

something = FILES
something {
  references {
    table = pages
    uid.current = 1
    fieldName = tx_boliusproducts_teaserimage
  }
  renderObj = TEXT
  renderObj{
    data = file:current:uid
  }
}

Fluid:

<f:image src="{f:cObject(typoscriptObjectPath:'something',data:'somedata')}" treatIdAsReference="true" maxWidth="200" />

Result:

<img src="/fileadmin/_processed_/csm_Screen_Shot_2014-04-02_at_11.32.46_01_942524ab1c.png" width="200" height="125" alt="">

Actions #5

Updated by Helmut Hummel about 10 years ago

  • Status changed from New to Closed
  • Priority changed from Should have to Won't have this time

So no action is needed here.

Actions

Also available in: Atom PDF