From b68c5d383a43cd5727ddd2d756b355b05d007465 Mon Sep 17 00:00:00 2001 From: Christian Kuhn <lolli@schwarzbu.ch> Date: Mon, 31 May 2021 13:11:44 +0200 Subject: [PATCH] [TASK] Raise typo3fluid/fluid ^2.7.0 A minor raise from 2.6 to 2.7 brings an aria related feature and a cleanup we adapt in core. composer req typo3fluid/fluid:^2.7.0 Resolves: #94242 Releases: master Change-Id: I9b479c33aa5183ea2bad845452dfa8cba52245e6 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69334 Tested-by: Oliver Bartsch <bo@cedev.de> Tested-by: core-ci <typo3@b13.com> Tested-by: Jochen <rothjochen@gmail.com> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Oliver Bartsch <bo@cedev.de> Reviewed-by: Jochen <rothjochen@gmail.com> Reviewed-by: Claus Due <claus@phpmind.net> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> --- composer.json | 2 +- composer.lock | 14 ++++---- phpstan.neon | 4 --- typo3/sysext/adminpanel/composer.json | 2 +- typo3/sysext/core/composer.json | 2 +- .../Core/Rendering/RenderingContext.php | 32 ++++++------------- .../Classes/View/AbstractTemplateView.php | 2 +- .../fluid/Classes/View/StandaloneView.php | 2 +- .../ViewHelpers/Be/LinkViewHelperTest.php | 3 +- typo3/sysext/fluid/composer.json | 2 +- typo3/sysext/redirects/composer.json | 2 +- 11 files changed, 26 insertions(+), 41 deletions(-) diff --git a/composer.json b/composer.json index e4f6959bb722..fd4eb0ff88a5 100644 --- a/composer.json +++ b/composer.json @@ -80,7 +80,7 @@ "typo3/cms-composer-installers": "^2.0 || ^3.0", "typo3/phar-stream-wrapper": "^3.1.6", "typo3/symfony-psr-event-dispatcher-adapter": "^1.0 || ^2.0", - "typo3fluid/fluid": "^2.6.10" + "typo3fluid/fluid": "^2.7.0" }, "require-dev": { "composer-runtime-api": "^2.0", diff --git a/composer.lock b/composer.lock index e171e5d14d66..010538df2385 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6f11a2c93ad6fec94d41cbd9f2623839", + "content-hash": "0a6013a98ba1ec2a7ab5e3719aa00cbe", "packages": [ { "name": "bacon/bacon-qr-code", @@ -4569,16 +4569,16 @@ }, { "name": "typo3fluid/fluid", - "version": "2.6.10", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/TYPO3/Fluid.git", - "reference": "f20db4e74cf9803c6cffca2ed2f03e1b0b89d0dc" + "reference": "3420f8cfd6afcfa98e077f40b8d34f9be12f079e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TYPO3/Fluid/zipball/f20db4e74cf9803c6cffca2ed2f03e1b0b89d0dc", - "reference": "f20db4e74cf9803c6cffca2ed2f03e1b0b89d0dc", + "url": "https://api.github.com/repos/TYPO3/Fluid/zipball/3420f8cfd6afcfa98e077f40b8d34f9be12f079e", + "reference": "3420f8cfd6afcfa98e077f40b8d34f9be12f079e", "shasum": "" }, "require": { @@ -4606,9 +4606,9 @@ "description": "The TYPO3 Fluid template rendering engine", "support": { "issues": "https://github.com/TYPO3/Fluid/issues", - "source": "https://github.com/TYPO3/Fluid/tree/2.6.10" + "source": "https://github.com/TYPO3/Fluid/tree/2.7.0" }, - "time": "2020-11-16T21:38:14+00:00" + "time": "2021-05-31T06:39:11+00:00" }, { "name": "webmozart/assert", diff --git a/phpstan.neon b/phpstan.neon index 26e7edd40cea..2da86236d902 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -62,10 +62,6 @@ parameters: message: "#^Unsafe usage of new static\\(\\)\\.$#" count: 1 path: typo3/sysext/workspaces/Classes/Domain/Record/WorkspaceRecord.php - - - message: "#^Class TYPO3Fluid\\\\Fluid\\\\Core\\\\Parser\\\\TemplateParser does not have a constructor and must be instantiated without any parameters\\.$#" - count: 1 - path: typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php - message: "#^Call to an undefined static method TYPO3Fluid\\\\Fluid\\\\Core\\\\Rendering\\\\RenderingContext\\:\\:getParserConfiguration\\(\\)\\.$#" count: 1 diff --git a/typo3/sysext/adminpanel/composer.json b/typo3/sysext/adminpanel/composer.json index bdcde8c112e3..eab86c818bbb 100644 --- a/typo3/sysext/adminpanel/composer.json +++ b/typo3/sysext/adminpanel/composer.json @@ -27,7 +27,7 @@ "typo3/cms-core": "11.3.*@dev", "typo3/cms-fluid": "11.3.*@dev", "typo3/cms-frontend": "11.3.*@dev", - "typo3fluid/fluid": "^2.6.10" + "typo3fluid/fluid": "^2.7.0" }, "conflict": { "typo3/cms": "*" diff --git a/typo3/sysext/core/composer.json b/typo3/sysext/core/composer.json index 117a6e1ec52e..40effa451e37 100644 --- a/typo3/sysext/core/composer.json +++ b/typo3/sysext/core/composer.json @@ -64,7 +64,7 @@ "typo3/cms-composer-installers": "^2.0 || ^3.0", "typo3/phar-stream-wrapper": "^3.1.6", "typo3/symfony-psr-event-dispatcher-adapter": "^1.0 || ^2.0", - "typo3fluid/fluid": "^2.6.10" + "typo3fluid/fluid": "^2.7.0" }, "require-dev": { "codeception/codeception": "^4.1.12", diff --git a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php b/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php index 7310367b9987..0752e41502fc 100644 --- a/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php +++ b/typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php @@ -32,7 +32,6 @@ use TYPO3Fluid\Fluid\Core\Parser\TemplateProcessorInterface; use TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider; use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker; use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer; -use TYPO3Fluid\Fluid\View\ViewInterface; /** * Class RenderingContext @@ -69,29 +68,18 @@ class RenderingContext extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext $this->viewHelperVariableContainer = $viewHelperVariableContainer; } - /** - * @param ViewInterface $view - */ - public function __construct(ViewInterface $view = null) + public function __construct() { - if ($view !== null) { - // Note: if $view is received here this indicates internal framework instancing - // and it is safe to call the parent constructor. Custom, non-view-providing - // usages will only perform the initialisation below (which is sufficient mind you!) - parent::__construct($view); - } else { - // Reproduced partial initialisation from parent::__construct; minus the custom - // implementations we attach below. - $this->setTemplateParser(new TemplateParser($this)); - if (method_exists($this, 'setTemplateCompiler')) { - $this->setTemplateCompiler(new TemplateCompiler()); - } - if (method_exists($this, 'setViewHelperInvoker')) { - $this->setViewHelperInvoker(new ViewHelperInvoker()); - } - $this->setViewHelperVariableContainer(new ViewHelperVariableContainer()); - $this->setVariableProvider(new StandardVariableProvider()); + // Reproduced partial initialisation from parent::__construct; minus the custom implementations we attach below. + $this->setTemplateParser(new TemplateParser()); + if (method_exists($this, 'setTemplateCompiler')) { + $this->setTemplateCompiler(new TemplateCompiler()); + } + if (method_exists($this, 'setViewHelperInvoker')) { + $this->setViewHelperInvoker(new ViewHelperInvoker()); } + $this->setViewHelperVariableContainer(new ViewHelperVariableContainer()); + $this->setVariableProvider(new StandardVariableProvider()); $objectManager = GeneralUtility::makeInstance(ObjectManager::class); if (method_exists($this, 'setTemplateProcessors')) { diff --git a/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php b/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php index b830ee047fdb..21392b5aa37d 100644 --- a/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php +++ b/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php @@ -50,7 +50,7 @@ abstract class AbstractTemplateView extends TemplateView implements ViewInterfac public function __construct(RenderingContextInterface $context = null) { if (!$context) { - $context = GeneralUtility::makeInstance(ObjectManager::class)->get(RenderingContext::class, $this); + $context = GeneralUtility::makeInstance(ObjectManager::class)->get(RenderingContext::class); } parent::__construct($context); } diff --git a/typo3/sysext/fluid/Classes/View/StandaloneView.php b/typo3/sysext/fluid/Classes/View/StandaloneView.php index 8e0bba68e1e5..5052c8529ab0 100644 --- a/typo3/sysext/fluid/Classes/View/StandaloneView.php +++ b/typo3/sysext/fluid/Classes/View/StandaloneView.php @@ -49,7 +49,7 @@ class StandaloneView extends AbstractTemplateView $configurationManager->setContentObject($contentObject); $request = $objectManager->get(Request::class); - $renderingContext = $objectManager->get(RenderingContext::class, $this); + $renderingContext = $objectManager->get(RenderingContext::class); $renderingContext->setRequest($request); parent::__construct($renderingContext); } diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/LinkViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/LinkViewHelperTest.php index 9a3410e89023..d54fb581dcfb 100644 --- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/LinkViewHelperTest.php +++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Be/LinkViewHelperTest.php @@ -71,9 +71,10 @@ class LinkViewHelperTest extends ViewHelperBaseTestcase ->setMethods(['registerTagAttribute', 'registerUniversalTagAttributes', 'registerArgument']) ->getMock(); - $viewHelper->expects(self::exactly(5))->method('registerArgument')->withConsecutive( + $viewHelper->expects(self::exactly(6))->method('registerArgument')->withConsecutive( ['additionalAttributes', 'array', self::anything()], ['data', 'array', self::anything()], + ['aria', 'array', self::anything()], ['route', 'string', self::anything()], ['parameters', 'array', self::anything()], ['referenceType', 'string', self::anything()] diff --git a/typo3/sysext/fluid/composer.json b/typo3/sysext/fluid/composer.json index 0a9a35c20c1c..71786a0409ca 100644 --- a/typo3/sysext/fluid/composer.json +++ b/typo3/sysext/fluid/composer.json @@ -22,7 +22,7 @@ "symfony/dependency-injection": "^5.2", "typo3/cms-core": "11.3.*@dev", "typo3/cms-extbase": "11.3.*@dev", - "typo3fluid/fluid": "^2.6.10" + "typo3fluid/fluid": "^2.7.0" }, "conflict": { "typo3/cms": "*" diff --git a/typo3/sysext/redirects/composer.json b/typo3/sysext/redirects/composer.json index 36902c8779ac..b601689c3f44 100644 --- a/typo3/sysext/redirects/composer.json +++ b/typo3/sysext/redirects/composer.json @@ -25,7 +25,7 @@ "symfony/console": "^5.2", "typo3/cms-backend": "11.3.*@dev", "typo3/cms-core": "11.3.*@dev", - "typo3fluid/fluid": "^2.6.10" + "typo3fluid/fluid": "^2.7.0" }, "conflict": { "typo3/cms": "*" -- GitLab