Issue Task Closed

#90289AbstractViewHelper class of TYPO3 8.7 can be compatible with Fluid 3.0 with minor changes

Claus Due 02/01/20, 14:01 updated 07/02/20, 17:44

Description

The following changes will make AbstractViewHelper from TYPO3 8.7 compatible with Fluid 3.0:

  • A condition must be added in registerRenderMethodArguments which checks if method_exists($this, ‘render’) before attempting to use Reflection to fetch arguments, since render() is optional in Fluid 3.0
  • The assigning of $this->controllerContext = $this->renderingContext->getControllerContext(); must be duplicated from prepareArguments to an overridden getArguments function (since prepareArguments is not called by Fluid 3.0 when creating the instance, but getArguments will)
  • The foreach of $this->argumentDefinitions in callRenderMethod must be changed to foreach $this->prepareArguments since $this->argumentDefinitions does not exist in Fluid 3.0
  • A condition must be added in registerRenderMethodArguments which assigns the ArgumentDefinition to a temporary variable $argumentDefinition and if ($this->arguments instanceof ArgumentCollection), call $this->arguments->addDefinition($argumentDefinition). Otherwise, assign into $this->argumentDefinitions.

Reviews 1