File tree Expand file tree Collapse file tree
Classes/Form/FormDataProvider Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020use TYPO3 \CMS \Backend \Form \FormDataProviderInterface ;
2121use TYPO3 \CMS \ContentBlocks \SiteSet \ContentBlockSiteRegistry ;
22+ use TYPO3 \CMS \Core \Schema \Exception \InvalidSchemaTypeException ;
2223use TYPO3 \CMS \Core \Schema \TcaSchemaFactory ;
2324use TYPO3 \CMS \Core \Site \Entity \Site ;
2425
@@ -36,8 +37,8 @@ public function __construct(
3637 public function addData (array $ result ): array
3738 {
3839 $ tableName = $ result ['tableName ' ];
39- $ contentElementSchema = $ this ->tcaSchemaFactory ->get ($ tableName );
40- if ($ tableName !== $ contentElementSchema ->getName ()) {
40+ $ schema = $ this ->tcaSchemaFactory ->get ($ tableName );
41+ if ($ tableName !== $ schema ->getName ()) {
4142 return $ result ;
4243 }
4344 $ site = $ result ['site ' ];
@@ -49,7 +50,11 @@ public function addData(array $result): array
4950 if ($ contentBlocks === []) {
5051 return $ result ;
5152 }
52- $ typeField = $ contentElementSchema ->getSubSchemaTypeInformation ()->getFieldName ();
53+ try {
54+ $ typeField = $ schema ->getSubSchemaTypeInformation ()->getFieldName ();
55+ } catch (InvalidSchemaTypeException ) {
56+ return $ result ;
57+ }
5358 $ items = $ result ['processedTca ' ]['columns ' ][$ typeField ]['config ' ]['items ' ] ?? [];
5459 if ($ items === []) {
5560 return $ result ;
You can’t perform that action at this time.
0 commit comments