Skip to content

Commit

Permalink
[TASK] Fix and clean up uncached renderer
Browse files Browse the repository at this point in the history
Restore v12 compatibility
  • Loading branch information
NamelessCoder committed Jul 24, 2023
1 parent 929fac4 commit 33def4d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 63 deletions.
20 changes: 0 additions & 20 deletions Classes/View/UncacheContentObject.php

This file was deleted.

3 changes: 1 addition & 2 deletions Classes/View/UncacheTemplateView.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class UncacheTemplateView extends TemplateView
{
public function callUserFunction(string $postUserFunc, array $conf, string $content): string
public function callUserFunction(string $postUserFunc, array $conf): string
{
$partial = $conf['partial'] ?? null;
$section = $conf['section'] ?? null;
Expand All @@ -31,7 +31,6 @@ public function callUserFunction(string $postUserFunc, array $conf, string $cont
? $parameters->getControllerExtensionName()
: $parameters['extensionName'] ?? null;


if (empty($partial)) {
return '';
}
Expand Down
20 changes: 12 additions & 8 deletions Classes/ViewHelpers/Render/UncacheViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

use FluidTYPO3\Vhs\Utility\RequestResolver;
use FluidTYPO3\Vhs\View\UncacheContentObject;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use FluidTYPO3\Vhs\View\UncacheTemplateView;
use TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
Expand Down Expand Up @@ -93,6 +94,7 @@ public static function renderStatic(
}

$conf = [
'userFunc' => UncacheTemplateView::class . '->callUserFunction',
'partial' => $arguments['partial'],
'section' => $arguments['section'],
'arguments' => $partialArguments,
Expand All @@ -103,14 +105,16 @@ public static function renderStatic(
$conf['partialRootPaths'] = $renderingContext->getTemplatePaths()->getPartialRootPaths();
}

$GLOBALS['TSFE']->config['INTincScript'][$substKey] = [
'type' => 'POSTUSERFUNC',
'cObj' => serialize(GeneralUtility::makeInstance(UncacheContentObject::class, $GLOBALS['TSFE']->cObj)),
'postUserFunc' => 'render',
'conf' => $conf,
'content' => $content
];
/** @var ContentObjectRenderer $contentObjectRenderer */
$contentObjectRenderer = $GLOBALS['TSFE']->cObj;

$content = $contentObjectRenderer->cObjGetSingle(
'COA_INT',
[
'10' => 'USER',
'10.' => $conf,
]
);
return $content;
}
}
33 changes: 0 additions & 33 deletions Tests/Unit/View/UncacheContentObjectTest.php

This file was deleted.

0 comments on commit 33def4d

Please sign in to comment.