Bug #100915
closed"Show references for this form" throws error for form definitions in Private path of custom extension
0%
Description
I store forms (which are not editable by editors and get deployed) in a custom extension in the path "Resources/Private/Forms". When I now click on the overview page of the "Forms" backend module on the three dots and select "Show references for this form" the following error occurs:
Tried to access a private resource file "EXT:my_ext/Resources/Private/Forms/my_form.form.yaml" from fallback compatibility storage. This storage only handles public files.
Exception code: 1633777536
The relevant parts of the stack trace:
in /var/www/html/vendor/typo3/cms-core/Classes/Resource/ResourceFactory.php line 325 at TYPO3\CMS\Form\Service\DatabaseService->getReferencesByPersistenceIdentifier('EXT:my_ext/Resources/Private/Forms/my_form.form.yaml') in /var/www/html/vendor/typo3/cms-form/Classes/Controller/FormManagerController.php line 452 at TYPO3\CMS\Form\Controller\FormManagerController->getProcessedReferencesRows('EXT:my_ext/Resources/Private/Forms/my_form.form.yaml') in /var/www/html/vendor/typo3/cms-form/Classes/Controller/FormManagerController.php line 295 at TYPO3\CMS\Form\Controller\FormManagerController->referencesAction('EXT:my_ext/Resources/Private/Forms/my_form.form.yaml') in /var/www/html/vendor/typo3/cms-extbase/Classes/Mvc/Controller/ActionController.php line 575
Updated by Riccardo De Contardi 2 months ago · Edited
I think this is still reproducible on version 12 (not tried 11 nor 13); I basically followed the guides here
- https://docs.typo3.org/c/typo3/cms-form/main/en-us/I/Concepts/Configuration/Index.html
- https://docs.typo3.org/c/typo3/cms-form/main/en-us/I/Concepts/FormFileStorages/Index.html
In detail
Prerequisites¶
- TYPO3 12.4.19
- a sitepackage EXT:my_site_package
Steps¶
1. I started creating a form inside the Form module (I used the default "Contact Form" example) and saved it aspublic/fileadmin/form_definitions/simpleFormTest.form.yaml
2. I added the file EXT:my_site_package/Configuration/Form/CustomFormSetup.yaml
persistenceManager: allowedExtensionPaths: 10: EXT:my_site_package/Resources/Private/Forms/
3. I edited EXT:my_site_package/ext_localconf.php
by adding:
call_user_func(function () { \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup( trim(' module.tx_form { settings { yamlConfigurations { 100 = EXT:my_site_package/Configuration/Form/CustomFormSetup.yaml } } } ') ); });
4. I added to my TypoScript template:
plugin.tx_form { settings { yamlConfigurations { 100 = EXT:my_site_package/Configuration/Form/CustomFormSetup.yaml } } }
5. I moved the file public/fileadmin/form_definitions/simpleFormTest.form.yaml
to EXT:my_site_package/Resources/Private/Forms/simpleFormTest.form.yaml
6. Cleared all cache with Install Tool
Results¶
The module Form shows the form definition "simpleFormTest" with the path EXT:my_site_package/Resources/Private/Forms/simpleFormTest.form.yaml
7. I added a form plugin CE inside a page, choosing the only form definition available
8. I went back to the Form module and the reference has been taken into account
9. I clicked on the "kebab menu" of the definition > choosed "show references for this form" from the dropdown
Results¶
- an empty Error message shows up on the bottom right corner (there is just the "Error" title)
- the Log module shows the entry:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1633777536: Tried to access a private resource file "EXT:my_site_package/Resources/Private/Forms/simpleFormTest.form.yaml" from fallback compatibility storage. This storage only handles public files. | TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException thrown in file /var/www/html/vendor/typo3/cms-core/Classes/Resource/ResourceFactory.php in line 312. Requested URL: https://typo3.12.it.ddev.site/typo3/module/web/FormFormbuilder/FormManager/references?token=--AnonymizedToken--&formPersistenceIdentifier=EXT:my_site_package/Resources/Private/Forms/simpleFormTest.form.yaml
Updated by Mathias Brodala about 1 month ago
- Is duplicate of Bug #102160: EXT:form Clicking on references of forms stored inside extensions leads to exception added
Updated by Mathias Brodala about 1 month ago
- Status changed from New to Closed
Closing in favor of #102160 which has a proposed fix.