Skip to content

Uncaught TYPO3 Exception #1528326468 on Unknown Resource Configuration #92

Description

@bm1-phillip

When building a RemoteResourceCollection from FlexForm or PHP configuration, the factory immediately throws an UnknownResourceException as soon as it encounters an entry that isn’t registered in the EXTCONF array under filefill.resourceHandler. In our case, this happens for the identifier sys_domain:

Uncaught TYPO3 Exception: #1528326468: Unexpected File Fill Resource configuration "sys_domain" 
IchHabRecht\Filefill\Exception\UnknownResourceException thrown in RemoteResourceCollectionFactory.php line 84

The factory throws an UnknownResourceException at the first unregistered identifier, aborting the entire request.
Replace the exception throw with a continue statement in both factory methods to skip unknown identifiers:

--- a/Classes/Resource/RemoteResourceCollectionFactory.php
+++ b/Classes/Resource/RemoteResourceCollectionFactory.php
@@ -33,7 +33,8 @@ class RemoteResourceCollectionFactory
             if (!isset(
                 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['filefill']['resourceHandler']
                 [$resource['identifier']]['handler']
-            )) {
-                throw new UnknownResourceException(
-                    'Unexpected File Fill Resource configuration "' . $resource['identifier'] . '"',
-                    1519788775
-                );
+            )) {
+                // Skip unknown resource identifiers instead of throwing an exception
+                continue;
+            }
@@ -82,7 +83,8 @@ class RemoteResourceCollectionFactory
             $identifier = key($resource);
 
             if (!isset(
                 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['filefill']
-            )) {
-                throw new UnknownResourceException(
-                    'Unexpected File Fill Resource configuration "' . $identifier . '"',
-                    1528326468
-                );
+            )) {
+                // Skip unknown resource identifiers instead of throwing an exception
+                continue;
+            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions