Issue Bug Closed

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

Nikita Hovratov 10/13/23, 09:10 updated 12/02/25, 14:37

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.

form-reference.png

Reviews 5

Files 2

History 1426

Show 1 earlier messages
  1. Stefan Terborg commented and changed PHP Version 8.3 <span data-processor="relativetime" data-value="2024-07-04T06:42:26+00:00" > 07/04/24, 06:42 </span>

    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.
  1. Markus Zipfel commented <span data-processor="relativetime" data-value="2024-09-03T13:52:34+00:00" > 09/03/24, 13:52 </span>

    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 (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.

  2. Markus Zipfel commented and changed TYPO3 Version 12 13 <span data-processor="relativetime" data-value="2024-09-05T08:41:00+00:00" > 09/05/24, 08:41 </span>

    nikitah sterborg @s-d-a 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

  3. Stefan Terborg commented <span data-processor="relativetime" data-value="2024-09-05T08:51:31+00:00" > 09/05/24, 08:51 </span>

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

  4. Benjamin Franzke commented and changed attached form-reference-readonly.png status Under Review Closed <span data-processor="relativetime" data-value="2024-10-10T15:38:21+00:00" > 10/10/24, 15:38 </span>

    With latest 13 `main` the form is rendered as readonly, that means I can no longer trigger this error:

    form-reference-readonly.png

    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.

  5. Gerrit Code Review pushed patch set 5 for main to change 85856 status Closed Under Review <span data-processor="relativetime" data-value="2024-10-18T14:02:44+00:00" > 10/18/24, 14:02 </span>

  6. André Buchmann commented <span data-processor="relativetime" data-value="2024-11-14T09:02:36+00:00" > 11/14/24, 09:02 </span>

    Can reproduce this with TYPO3 12.4.23 in a composer instance

  7. Garvin Hicking commented <span data-processor="relativetime" data-value="2024-11-14T09:31:39+00:00" > 11/14/24, 09:31 </span>

    @schliesser If you could try the related patch, it’s missing votes but may be addressed soon ;)

  8. André Buchmann commented <span data-processor="relativetime" data-value="2024-11-14T09:50:40+00:00" > 11/14/24, 09:50 </span>

    Garvin Hicking wrote in #note-19:
    > @schliesser If you could try the related patch, it’s missing votes but may be addressed soon ;)

    Done. The patch works in 12.4.23

  9. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-11-18T14:30:09+00:00" > 11/18/24, 14:30 </span>

    Applied in changeset commit:9951e36813a423409059f5444f97c22a6996b5a4.