Project

General

Profile

Actions

Bug #98719

closed

Fluid ImageViewHelper : image not found if any special char in the path

Added by Olivier Massot over 1 year ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2022-10-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
fluid
Complexity:
Is Regression:
Sprint Focus:

Description

If there is any special char in the path of a file, the ImageService::getImageFromSourceString won't find it.

Exemple : A BE user creates an image named 'image.png' in a directory named "Évènements" ("events" in french) in the File module of the backend. He then add it to the Resources section of a page. Because the page template includes a <f:image .../> viewhelper, the page crash, and he gets the following error : Folder "/user_upload/615810/Ev%C3%A9nements/image.png/" does not exist.

To reproduce :

1. Insert a <f:image .../> viewhelper in a page, and use the FalViewHelper and the ForViewHelper to iterate over the page resources and display them
2. Create a directory named "Évènements" in the file module of the BE
3. Add any image in this folder
4. Add this image to the page resources
5. Open the page

Actions #1

Updated by Simon Praetorius about 1 year ago

  • Status changed from New to Needs Feedback

Could you check if your installation uses $GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']? This seems to me like a installation-wide issue, not just Fluid.

Actions #2

Updated by Olivier Massot about 1 year ago

"UTF8filesystem" is set to "1"

Actions #3

Updated by Riccardo De Contardi 7 months ago

I performed the following test:

  • TYPO3 13.0.0-dev (latest main)
  • $GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'] = true

1) TYPO3 Backend > TypoScript Module > on the TypoScript template I wrote (just the relevant parts):

page = PAGE
page.10 = FLUIDTEMPLATE
page.10{
  file = fileadmin/Templates/Index.html

  dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
      dataProcessing.10 {
        references {
                table = pages
                fieldName = media
        }
        as = headerImage
      } 
}

2) On the file fileadmin/Templates/Index.html I wrote

<f:if condition="{headerImage.0}">
    <f:image image="{headerImage.0}" />
</f:if>

3) Then I created a folder

/fileadmin/Images/Évènements

4) TYPO3 backend > FileList Module > I browsed the folders until "Évènements" (the name is diplayed correctly in the backend) and there I uploaded a file test.jpg inside

5) TYPO3 backend > Page Module > Home > edit page properties > Tab "Resources" > I selected the test.jpg file

6) Save the page & visit the frontend

Results:

the image is visible and the source code of the page reads:

<img src="https://typo3.main.it.ddev.site:8443/fileadmin/Images/E%CC%81ve%CC%80nements/test.jpg" width="559" height="739" alt="" />

Is a different test necessary?

Actions #4

Updated by Garvin Hicking about 1 month ago

  • Status changed from Needs Feedback to Closed

I am closing this issue because I believe it is very likely a configuration issue of the underlying operating system / filesystem.

Generally TYPO3 only uses the underlying file system structure, so the charsets of the database, filesystem and browser need to match. Preferrably all with UTF-8. I believe somewhere in this installation there must be a mismatch and maybe the filesystem actually is NOT UTF-8 but latin1 or something else. In this case, the webserver with its file system itself would need inspection, which is a bit of beyond the scope of this issue tracker. Maybe you can come to the Slack chat and see if we can help you to debug this further.

If you believe this is a mistake, please feel free to respond here or create a follow-up ticket. Thank you!

Actions

Also available in: Atom PDF