Issue Bug Closed

#106518Wrong filepath generated in createFromProcessedFile

Franz Holzinger 04/07/25, 19:13 updated 12/02/25, 14:22

Description

An 1314516809 InvalidArgumentException is thrown in typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php line 26.

File /mydomain.com/fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg does not exist.

The file exists at the location /fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg !

https://mydomain.com/fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg shows the image file.

Further investigations shows this:

Array    
0    /home/users/domain/www/mydomain.com/https
1    //mydomain.com/fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg
getFileObjectFromCombinedIdentifier $parts Pos 1

ResourceFactory.php    #199    ->debug

Somethings seems to be wrong with the internally used ResourceFactory::getFileObjectFromCombinedIdentifier

//mydomain.com/fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg

getFileObjectFromCombinedIdentifier $fileIdentifier Pos 2

/home/users/mydomain/www/mydomain.com/mydomain.com/fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg

getFileInfoByIdentifier $absoluteFilePath

LocalDriver.php    #258    ->debug

The LocalDriver.php gives the wrong file path containing “/mydomain.com/mydomain.com/”. Only one part “/mydomain.com/” would have been correct:
_/home/users/mydomain/www/mydomain.com/fileadmin/uploads/reparaturservice/uhren/luxusuhren/breitling-reparatur-komplettrevision.jpg
_

But what can be the reason for this error? Is the internal combined file identifier wrong?

Reviews 3

Files 1

History 711

  1. Franz Holzinger commented and changed attached patch-106518.diff subject Exception file does not exist Wrong filepath generated in createFromProcessedFile <span data-processor="relativetime" data-value="2025-04-09T20:36:04+00:00" > 04/09/25, 20:36 </span>

    The reason of the error comes from typo3_src-13.4.8/typo3/sysext/core/Classes/Imaging/ImageResource.php

    Environment::getPublicPath() . '/' . $processedFile->getPublicUrl()

    This adds the url with the “https://” into a relative file path. This leads only to a not found file under this wrong full file path!

    The attached patch patch-106518.diff fixes this issue.

  2. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-04-12T19:00:07+00:00" > 04/12/25, 19:00 </span>

    Applied in changeset commit:aef7ceda3b4b4b4e52efd6796d0a5e31f2adea94.