Issue Bug Needs Feedback Stale

#87979TYPO3\CMS\Extbase\Service::getImageUri in CLI Mode

Ralf Hübner 03/22/19, 09:30 updated 05/26/26, 15:27

Description

Hi,

i´ve the follwoing problem in TYPO3 v9.5.5 / Composer-Mode, Public-Root is “web”:

I use this TYPO3-Service “TYPO3\CMS\Extbase\Service::getImageUri” to retrieve the image path´s, e.g. for a Json-File.

But there is some confusion with the “uriPrefix”:

If this is called from the frontend, always fine – the path will be correct: _fileadmin/…_
but I run this service also in a Command/CLI and it seems the calculated “doc-root” is the composer-dir”: _*/web/*fileadmin/…_
This path is wrong against the frontend because the doc-Root itself is “web”.

My question is now:
Where ever I have to set a special “TYPO3_SITE_PATH” manually for CLI-Mode or is it a normal behavior or maybe a bug?

Kind regards
Ralf

Reviews 1

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch

Commit message
[BUGFIX] TYPO3\CMS\Extbase\Service::getImageUri in CLI Mode Resolves: #87979 Releases: main