Project

General

Profile

Actions

Bug #102160

open

EXT:form Clicking on references of forms stored inside extensions leads to exception

Added by Nikita Hovratov about 1 year ago. Updated 4 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2023-10-13
Due date:
% Done:

0%

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

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

form-reference.png (2.39 KB) form-reference.png Nikita Hovratov, 2023-10-13 09:10
form-reference-readonly.png (7.04 KB) form-reference-readonly.png Benjamin Franzke, 2024-10-10 15:34

Related issues 2 (0 open2 closed)

Has duplicate TYPO3 Core - Task #104804: [BUGFIX] EXT:form Clicking on references of forms stored inside exten…Closed2024-09-03

Actions
Has duplicate TYPO3 Core - Bug #100915: "Show references for this form" throws error for form definitions in Private path of custom extensionClosed2023-05-24

Actions
Actions #1

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.
Actions #2

Updated by Andreas Kießling about 2 months ago

Still present in 12.4.19

Actions #3

Updated by Markus Zipfel about 2 months ago · Edited

I can confirm the issue, too. We also did some further research on that and I can share what we found out so far:
  • 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 v11 Environment::getPublicPath() was the "private" web root folder (for whatever reason). In v12 it's the "public" web directory - like defined in web-dir in composer.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 opinion ResourceFactory->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 for master.

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.

Actions #4

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

Actions #5

Updated by Garvin Hicking about 2 months ago

  • Has duplicate Task #104804: [BUGFIX] EXT:form Clicking on references of forms stored inside exten… added
Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Stefan Terborg about 2 months ago

Seems to work in TYPO3 12.4.19. The info popup appears, no errors in console.

Actions #10

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
Actions #11

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

Actions #12

Updated by Benjamin Franzke 12 days ago

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.

Actions #13

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

Actions

Also available in: Atom PDF