Bug #102160
openEXT:form Clicking on references of forms stored inside extensions leads to exception
0%
Description
This is the exception message:
Fri, 13 Oct 2023 11:06:09 +0200 [CRITICAL] request="5eed67f9280ad" component="TYPO3.CMS.Core.Error.DebugExceptionHandler": Core: Exception handler (WEB: BE): TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException, code #1633777536, file /var/www/html/vendor/typo3/cms-core/Classes/Resource/ResourceFactory.php, line 312: Tried to access a private resource file " EXT:example/Resources/Private/Forms/myForm.form.yaml " from fallback compatibility storage. This storage only handles public files.
Files
Updated by Stefan Terborg 4 months ago
- PHP Version set to 8.3
Can confirm with TYPO3 12.4.16.
Error message:
Uncaught TYPO3 Exception: #1633777536: Tried to access a private resource file "EXT:my_ext/Resources/Private/FormYaml/my.form.yaml" from fallback compatibility storage. This storage only handles public files.
Updated by Markus Zipfel about 2 months ago · Edited
ResourceFactory->retrieveFileOrFolderObject()
is not able to resolve files from "EXT:.../Resources/Private/...", anymore.- Source is line 306 of
ResourceFactory
:if (str_starts_with($absoluteFilePath, Environment::getPublicPath()))
because in v11Environment::getPublicPath()
was the "private" web root folder (for whatever reason). In v12 it's the "public" web directory - like defined inweb-dir
incomposer.json
. - So I think at first we have to discuss if it is not the expected behaviour that
ResourceFactory
is not able to retrieve extensions' private resources because in first place, it is meant to deal with FAL resources. Means: In my opinionResourceFactory->retrieveFileOrFolderObject()
should not be changed. - My suggestion is to update
DatabaseService->getReferencesByPersistenceIdentifier
so that it is able to deal with form persistence identifiers if no FAL file can be retrieved. I don't have a nice fix, yet. But I will try to create a pull request if I will find some time. But if I do, I will provide a PR formaster
.
Suggestion for a temporary fix for all users that do not have the time to wait:
Move your form YAML files to a EXT:.../Resources/Public/Forms/
folder and prevent web access by providing a .htaccess
file with content Deny from all
in that folder.
Updated by Gerrit Code Review about 2 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85856
Updated by Garvin Hicking about 2 months ago
- Has duplicate Task #104804: [BUGFIX] EXT:form Clicking on references of forms stored inside exten… added
Updated by Gerrit Code Review about 2 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85856
Updated by Gerrit Code Review about 2 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85856
Updated by Markus Zipfel about 2 months ago · Edited
- TYPO3 Version changed from 12 to 13
@Nikita Hovratov @Stefan Terborg @Andreas Kießling I provided a patch to solve this issue. Maybe one of you has the time to check if it also works for you: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85856
Updated by Stefan Terborg about 2 months ago
Seems to work in TYPO3 12.4.19. The info popup appears, no errors in console.
Updated by Mathias Brodala 25 days ago
- Has duplicate Bug #100915: "Show references for this form" throws error for form definitions in Private path of custom extension added
Updated by Gerrit Code Review 25 days ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85856
Updated by Benjamin Franzke 12 days ago
- File form-reference-readonly.png form-reference-readonly.png added
- Status changed from Under Review to Closed
With latest 13 `main` the form is rendered as readonly, that means I can no longer trigger this error:
Therefore I'm closing this.
Note: When forcing the URL to be opened by appending it to the query parameter, it does not produce that error but an exception: "Edit an extension formDefinition is not allowed." – not perfect, but ok for now.
Updated by Gerrit Code Review 4 days ago
- Status changed from Closed to Under Review
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85856