1313use TYPO3 \CMS \Frontend \ContentObject \ContentObjectRenderer ;
1414use TYPO3 \CMS \Frontend \ContentObject \DataProcessorInterface ;
1515
16- final class RelationProcessor implements DataProcessorInterface
16+ final readonly class RelationProcessor implements DataProcessorInterface
1717{
1818 public function __construct (
19- private readonly ConnectionPool $ connectionPool ,
20- private readonly ContentDataProcessor $ contentDataProcessor
19+ private ConnectionPool $ connectionPool ,
20+ private ContentDataProcessor $ contentDataProcessor
2121 ) {
2222 }
2323
@@ -42,7 +42,8 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
4242
4343 foreach ($ relations as $ key => $ record ) {
4444 $ recordContentObjectRenderer = GeneralUtility::makeInstance (ContentObjectRenderer::class);
45- $ recordContentObjectRenderer ->start ($ record , $ GLOBALS ['TCA ' ][$ table ]['columns ' ][$ field ]['config ' ]['foreign_table ' ], $ request );
45+ $ recordContentObjectRenderer ->setRequest ($ request );
46+ $ recordContentObjectRenderer ->start ($ record , $ GLOBALS ['TCA ' ][$ table ]['columns ' ][$ field ]['config ' ]['foreign_table ' ]);
4647 $ processedRecordVariables [$ key ] = ['data ' => $ record ];
4748 $ processedRecordVariables [$ key ] = $ this ->contentDataProcessor ->process (
4849 $ recordContentObjectRenderer ,
@@ -61,10 +62,11 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
6162 public function getRelation (ContentObjectRenderer $ cObj , string $ table , string $ field , int $ uid ): array
6263 {
6364 $ tcaConfig = $ GLOBALS ['TCA ' ][$ table ]['columns ' ][$ field ]['config ' ] ?? throw new RuntimeException (
64- 'TCA config for ' . $ table . '. ' . $ field . ' not found '
65+ 'TCA config for ' . $ table . '. ' . $ field . ' not found ' ,
66+ 9447139781
6567 );
6668
67- $ foreignTable = $ tcaConfig ['foreign_table ' ] ?? throw new RuntimeException ('TCA config foreign_table not found ' );
69+ $ foreignTable = $ tcaConfig ['foreign_table ' ] ?? throw new RuntimeException ('TCA config foreign_table not found ' , 4960954942 );
6870
6971 if (isset ($ tcaConfig ['foreign_field ' ])) {
7072 $ rows = $ this ->getRowsForeignField ($ tcaConfig , $ foreignTable , $ uid );
@@ -77,7 +79,7 @@ public function getRelation(ContentObjectRenderer $cObj, string $table, string $
7779 $ records = [];
7880
7981 $ pageRepository = $ cObj ->getTypoScriptFrontendController ()?->sys_page;
80- $ pageRepository instanceof PageRepository ?: throw new RuntimeException ('PageRepository not found ' );
82+ $ pageRepository instanceof PageRepository ?: throw new RuntimeException ('PageRepository not found ' , 4904331429 );
8183
8284 foreach ($ rows as $ row ) {
8385 // Versioning preview:
@@ -172,18 +174,18 @@ private function getRowsLocalField(array $tcaConfig, string $foreignTable, strin
172174 private function getRowsMM (mixed $ tcaConfig , mixed $ foreignTable , int $ uid ): array
173175 {
174176 if (isset ($ tcaConfig ['MM_hasUidField ' ])) {
175- throw new RuntimeException ('TCA config MM_hasUidField not supported ' );
177+ throw new RuntimeException ('TCA config MM_hasUidField not supported ' , 5983628871 );
176178 }
177179
178180 if (isset ($ tcaConfig ['MM_is_foreign ' ])) {
179- throw new RuntimeException ('TCA config MM_is_foreign not supported ' );
181+ throw new RuntimeException ('TCA config MM_is_foreign not supported ' , 9865861365 );
180182 }
181183
182184 if (isset ($ tcaConfig ['MM_oppositeUsage ' ])) {
183- throw new RuntimeException ('TCA config MM_oppositeUsage not supported ' );
185+ throw new RuntimeException ('TCA config MM_oppositeUsage not supported ' , 5536564928 );
184186 }
185187
186- $ mmTable = $ tcaConfig ['MM ' ] ?? throw new RuntimeException ('TCA config MM not found ' );
188+ $ mmTable = $ tcaConfig ['MM ' ] ?? throw new RuntimeException ('TCA config MM not found ' , 3744368881 );
187189
188190 $ matchFields = $ tcaConfig ['MM_match_fields ' ] ?? [];
189191
0 commit comments