1313 */
1414
1515use B13 \Container \Domain \Factory \Exception ;
16- use B13 \Container \Domain \Factory \PageView \ Frontend \ ContainerFactory ;
16+ use B13 \Container \Domain \Factory \FrontendContainerFactory ;
1717use B13 \Container \Domain \Model \Container ;
1818use Psr \Http \Message \ServerRequestInterface ;
1919use TYPO3 \CMS \Core \Context \Context ;
20- use TYPO3 \CMS \Core \Context \LanguageAspect ;
2120use TYPO3 \CMS \Core \Utility \GeneralUtility ;
2221use TYPO3 \CMS \Frontend \ContentObject \ContentDataProcessor ;
2322use TYPO3 \CMS \Frontend \ContentObject \ContentObjectRenderer ;
2423use TYPO3 \CMS \Frontend \ContentObject \DataProcessorInterface ;
2524
2625class ContainerProcessor implements DataProcessorInterface
2726{
28- /**
29- * @var ContainerFactory
30- */
31- protected $ containerFactory ;
3227
3328 /**
3429 * @var ContentDataProcessor
3530 */
3631 protected $ contentDataProcessor ;
3732
3833 protected Context $ context ;
34+ protected FrontendContainerFactory $ frontendContainerFactory ;
3935
40- public function __construct (ContainerFactory $ containerFactory , ContentDataProcessor $ contentDataProcessor , Context $ context )
36+ public function __construct (ContentDataProcessor $ contentDataProcessor , Context $ context, FrontendContainerFactory $ frontendContainerFactory )
4137 {
42- $ this ->containerFactory = $ containerFactory ;
4338 $ this ->contentDataProcessor = $ contentDataProcessor ;
4439 $ this ->context = $ context ;
40+ $ this ->frontendContainerFactory = $ frontendContainerFactory ;
4541 }
4642
4743 public function process (
@@ -53,16 +49,15 @@ public function process(
5349 if (isset ($ processorConfiguration ['if. ' ]) && !$ cObj ->checkIf ($ processorConfiguration ['if. ' ])) {
5450 return $ processedData ;
5551 }
52+ $ contentId = null ;
5653 if ($ processorConfiguration ['contentId. ' ] ?? false ) {
5754 $ contentId = (int )$ cObj ->stdWrap ($ processorConfiguration ['contentId ' ], $ processorConfiguration ['contentId. ' ]);
5855 } elseif ($ processorConfiguration ['contentId ' ] ?? false ) {
5956 $ contentId = (int )$ processorConfiguration ['contentId ' ];
60- } else {
61- $ contentId = (int )$ cObj ->data ['uid ' ];
6257 }
6358
6459 try {
65- $ container = $ this ->containerFactory ->buildContainer ($ contentId );
60+ $ container = $ this ->frontendContainerFactory ->buildContainer ($ cObj , $ this -> context , $ contentId );
6661 } catch (Exception $ e ) {
6762 // do nothing
6863 return $ processedData ;
@@ -109,22 +104,12 @@ protected function processColPos(
109104 if ($ contentRecordRenderer === null ) {
110105 throw new ContainerDataProcessingFailedException ('RECORDS content object not available. ' , 1691483526 );
111106 }
112-
113107 $ conf = [
114108 'tables ' => 'tt_content ' ,
115109 ];
116- /** @var LanguageAspect $languageAspect */
117- $ languageAspect = $ this ->context ->getAspect ('language ' );
118110 foreach ($ children as &$ child ) {
119111 if (!isset ($ processorConfiguration ['skipRenderingChildContent ' ]) || (int )$ processorConfiguration ['skipRenderingChildContent ' ] === 0 ) {
120- if ($ child ['l18n_parent ' ] > 0 && $ languageAspect ->doOverlays ()) {
121- $ conf ['source ' ] = $ child ['l18n_parent ' ];
122- } else {
123- $ conf ['source ' ] = $ child ['uid ' ];
124- }
125- if ($ child ['t3ver_oid ' ] > 0 ) {
126- $ conf ['source ' ] = $ child ['t3ver_oid ' ];
127- }
112+ $ conf ['source ' ] = $ child ['uid ' ];
128113 $ child ['renderedContent ' ] = $ cObj ->render ($ contentRecordRenderer , $ conf );
129114 }
130115 /** @var ContentObjectRenderer $recordContentObjectRenderer */
0 commit comments