refactor: apply TYPO3 13 Rector and Fractor migrations
Automated migrations from rector.php and fractor.php (TCA, Extbase controllers and annotations, ViewHelpers, QueryBuilder, FlexForms, TypoScript conditions). Plugins stay list_type plugins: Rector switched them to content element types, which needs a tt_content migration. That is deferred to the TYPO3 14 step, where list_type is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1b958a6084
commit
41b9302d9b
119 files changed
+2211
-2581
No files matched your search
@@ -70,7 +70,7 @@ class AjaxViewHelper extends ActionViewHelper
|
||||
|
||||
// Use root page uid as target unless provided
|
||||
if ($arguments['pageUid'] === null) {
|
||||
$rootlineUtility = new RootlineUtility($GLOBALS['TSFE']->id);
|
||||
$rootlineUtility = new RootlineUtility($GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.page.information')->getId());
|
||||
$rootline = $rootlineUtility->get();
|
||||
$rootPage = array_pop($rootline);
|
||||
$arguments['pageUid'] = $rootPage['uid'];
|
||||
|
||||
@@ -29,12 +29,9 @@ namespace EP\EpTheme\ViewHelpers\Uri;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class ProductViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
@@ -53,25 +50,21 @@ class ProductViewHelper extends AbstractViewHelper
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$product = $arguments['product'];
|
||||
$hotel = $arguments['hotel'];
|
||||
|
||||
if ($arguments['forceHotelUid']) {
|
||||
public function render()
|
||||
{
|
||||
$product = $this->arguments['product'];
|
||||
$hotel = $this->arguments['hotel'];
|
||||
if ($this->arguments['forceHotelUid']) {
|
||||
// Product detail page with forced hotel
|
||||
$linkArguments = [
|
||||
'product' => is_array($product) ? $product['uid'] : $product,
|
||||
'hotel' => is_array($hotel) ? $hotel['uid'] : $hotel,
|
||||
];
|
||||
} elseif ($arguments['dateFrom'] || $arguments['dateTo']) {
|
||||
} elseif ($this->arguments['dateFrom'] || $this->arguments['dateTo']) {
|
||||
// Product detail page with forced date range
|
||||
$linkArguments = [
|
||||
'dateFrom' => $arguments['dateFrom'],
|
||||
'dateTo' => $arguments['dateTo'],
|
||||
'dateFrom' => $this->arguments['dateFrom'],
|
||||
'dateTo' => $this->arguments['dateTo'],
|
||||
];
|
||||
} else {
|
||||
// Default product detail page by product uid
|
||||
@@ -79,24 +72,20 @@ class ProductViewHelper extends AbstractViewHelper
|
||||
'product' => is_array($product) ? $product['uid'] : $product,
|
||||
];
|
||||
}
|
||||
|
||||
$targetPageUid = is_array($product) ? (int)$product['detailPage'] : $product->getDetailPage();
|
||||
|
||||
$uri = $renderingContext
|
||||
$uri = $this->renderingContext
|
||||
->getControllerContext()
|
||||
->getUriBuilder()
|
||||
->reset()
|
||||
->setTargetPageUid($targetPageUid)
|
||||
->uriFor('detail', $linkArguments, 'Product', 'epproducts', 'product_detail')
|
||||
;
|
||||
|
||||
if ($arguments['ref']) {
|
||||
$referringPageUri = urlencode($arguments['ref']);
|
||||
if ($this->arguments['ref']) {
|
||||
$referringPageUri = urlencode($this->arguments['ref']);
|
||||
$hasQuery = null !== parse_url($uri, PHP_URL_QUERY);
|
||||
$separator = $hasQuery ? '&' : '?';
|
||||
$uri .= $separator . 'ref=' . $referringPageUri;
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,12 +29,9 @@ namespace EP\EpTheme\ViewHelpers\Uri;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class VideoViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
@@ -54,21 +51,16 @@ class VideoViewHelper extends AbstractViewHelper
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
)
|
||||
public function render()
|
||||
{
|
||||
// YouTube
|
||||
if ((int) $arguments['layout'] === 0) {
|
||||
return $arguments['value'] . '?rel=0&controls=0&showinfo=0';
|
||||
if ((int) $this->arguments['layout'] === 0) {
|
||||
return $this->arguments['value'] . '?rel=0&controls=0&showinfo=0';
|
||||
}
|
||||
// Vimeo
|
||||
if ((int) $arguments['layout'] === 1) {
|
||||
return sprintf('https://player.vimeo.com/video/%d?html5=1', $arguments['value']);
|
||||
if ((int) $this->arguments['layout'] === 1) {
|
||||
return sprintf('https://player.vimeo.com/video/%d?html5=1', $this->arguments['value']);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user