Project

General

Profile

Actions

Bug #106368

open

Exception in filelist module with "List" view

Added by Julian Mair 2 days ago. Updated 1 day ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2025-03-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

First, make sure that you:

  • are in Debug Mode (Settings > Configuration Presets > Debug = "Debug", Reason: Warnings should be thrown as exceptions)
  • have a storage with filemount inside your site_package (e.g. to the Resources folder)
  • you are a non-admin with that filemount granted

Procedure

Go, as a non-admin, to the FileList, select "List" view (with "Tiles" the exception doesn't occur) and then select a folder with images in it, here it was "site_package/Resources/Public/Icons" with the "Extension.svg" in it .
In all my Typo3 v13 Webs, the exception from the screenshot occur.

I xdebug'd this and in what I understand, deep in \TYPO3\CMS\Core\Resource\Driver\LocalDriver::getAbsolutePath the variable $this->absoluteBasePath has the wrong base path aka the wrong file storage. I have no idea why...

protected function getAbsolutePath(string $fileIdentifier): string
{
   $relativeFilePath = ltrim($this->canonicalizeAndCheckFileIdentifier($fileIdentifier), '/');
   return $this->absoluteBasePath . $relativeFilePath;
}


Files


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #101968: Exception in filelist for storages with baseUri setClosedOliver Bartsch2023-09-20

Actions
Actions #1

Updated by Julian Mair 2 days ago

  • Related to Bug #101968: Exception in filelist for storages with baseUri set added
Actions #2

Updated by Garvin Hicking 2 days ago

  • Category set to File Abstraction Layer (FAL)
  • Status changed from New to Needs Feedback

This is a TYPO3 classic mode installation, not composer, I assume?

Actions #3

Updated by Julian Mair 2 days ago

yes, it's a composer installation... an upgrade from v12 to be precise

Actions #4

Updated by Georg Ringer 1 day ago

hey!

I really wonder why there is a need to have a storage which points to a extension? can you give some usescases for that? I really tend to close this because this is not the way to go IMHO

Actions #5

Updated by Julian Mair 1 day ago

hey georg, it's mostly because we have a bunch of files, like logos, icons, background banners, etc. which we want to store via GIT (fileadmin/ is not under VCS). In most cases, its a read-only filemount so that the users can select those files in the backend, but are not allowed to change them.

Side note: we are doing this since Typo3 v9, and it always worked until v13 (i think with #101968 )

Actions #6

Updated by Garvin Hicking 1 day ago

I would suggest to place a symlink in a normal fileadmin/ UGC directory pointing to your extension. Then you can manage the files as if they were part of your UGC - and then probably extension directory mapping will not interfer?

Actions #7

Updated by Julian Mair 1 day ago

I already do that, the URI of the thumbnail mentioned above is "/site_package_resources/Public/Icons/Extension.svg"
("site_package_resources" is a symlink to "/site_package/Resources/" located in the DOCROOT)

But IMHO the bug lies in the second condition:

/vendor/typo3/cms-filelist/Classes/FileList.php:698 - 705

if (($thumbnailUrl = ($processedFile->getPublicUrl() ?? '')) === '') {
    // Prevent rendering of a "img" tag with an empty "src" attribute
    return '';
}

if (PathUtility::isAbsolutePath($thumbnailUrl)) {
    $thumbnailUrl .= '?' . filemtime($processedFile->getForLocalProcessing(false));
}

The var $thumbnailUrl is correctly generated but filemtime($processedFile->getForLocalProcessing(false)) will trigger the exception above with the completely incorrect path "/var/www/html/httpdocs/fileadmin/Public/Icons/Extension.svg" which doesn't exist.

Actions

Also available in: Atom PDF