Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Abuse of storage 0 for extension resources #1100

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gilbertsoft
Copy link
Contributor

@gilbertsoft gilbertsoft commented Oct 11, 2021

This patch makes sure the virtual storage 0 is not longer abused by the
StaticFilesProcessor. Therefor the StaticFilesProcessor now returns URIs
of the provided files and not longer FILE objects.

All EXT: references are now properly resolved through
PathUtility::getPublicResourceWebPath() if available (TYPO3 11.4.0 and
higher) or by providing an absolute path to
PathUtility::getAbsoluteWebPath.

FAL resources are resolved using PathUtility::getAbsoluteWebPath also
by providing an absolute path.

The new behavior is disabled by default and can be enabled by setting
"compatibilityMode" to "false".

@gilbertsoft gilbertsoft force-pushed the bugfix/static-file-processor branch 9 times, most recently from 0007988 to d1b436e Compare October 11, 2021 11:36
This patch makes sure the virtual storage 0 is not longer abused by the
StaticFilesProcessor. Therefor the StaticFilesProcessor now returns URIs
of the provided files and not longer FILE objects.

All `EXT:` references are now properly resolved through
`PathUtility::getPublicResourceWebPath()` if available (TYPO3 11.4.0 and
higher) or by providing an absolute path to
`PathUtility::getAbsoluteWebPath`.

FAL resources are resolved using `PathUtility::getAbsoluteWebPath` also
by providing an absolute path.

The new behavior is disabled by default and can be enabled by setting
"compatibilityMode" to "false".
@benjaminkott
Copy link
Owner

benjaminkott commented Oct 13, 2021

This approach is totally off the track, we need to be able to generate file objects no matter where they are stored.
It must be possible that the core delivers file objects to handle assets no matter where stored. Otherwise, we cannot handle/process them at all. That the core builds fake storage for them is not our problem to solve nor to handle.

The only reason the static files processor exists is to get the file objects. Path resolving would also be possible in other ways.

@helhum
Copy link
Contributor

helhum commented Oct 28, 2021

It must be possible that the core delivers file objects to handle assets no matter where stored.

I agree. However, that core currently can't do that (without relying on a technology that is broken by design).

Otherwise, we cannot handle/process them at all. That the core builds fake storage for them is not our problem to solve nor to handle.

Well, it IS a problem to be handled here until the core is able to deliver what is needed in a clean and meaningful way.

I see two options: Deprecate the StaticFilesProcessor.php (because it currently can't hold to its promises) and introduce a new one to just resolve URLs, or introduce a new concept using objects here.

We can't just use technology that is broken by wishfully thinking it is not and (even worse) recommend other to do so as well (which is implicitly done as the official TYPO3 introduction package is based on the bootstrap package).

We can discuss the best options how this can be handled, but it MUST be handled anyway, latest, when FAL storage 0 is deprecated in the TYPO3 core.

@helhum
Copy link
Contributor

helhum commented Oct 28, 2021

I would say, that deprecating the StaticFilesProcessor is the only viable option here.

@gilbertsoft
Copy link
Contributor Author

My change here is a draft for a good reason and it may change when the core delivers new options. For the moment the StaticFilesProcessor still works as long as no composer vendor installation is in place (TYPO3 and Extensions installed in vendor).

The default configuration currently has one issue here with the logo which also can be solved in another way, for all useful options to include the logo the processor is imho anyway superfluous and could be omited.

I will try to keep this PR up to date with the coming core changes to finally get a solution on which everybody can agree...

@gilbertsoft
Copy link
Contributor Author

Oh and I'm currently dreaming of an API which makes it possible to address each file as a file object like done for FAL. But that's something which may come with v12...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants