[TYPO3-dev] Strange error in fluid, closure is null

Oliver Salzburg kinggencha at googlemail.com
Tue Nov 8 15:01:19 CET 2011


On 2011-11-08 14:30, Tim Wentzlau wrote:
> Hi list
>
> Before I fill in a bug report I would like to know if there is any of
> you who get errors like this in typo3 4.6 (php 5.3.2):
>
> PHP Catchable Fatal Error: Argument 1 passed to
> Tx_Fluid_Core_ViewHelper_AbstractViewHelper::setRenderChildrenClosure()
> must be an instance of Closure, null given, called in
> /var/www/t3/typo3temp/Cache/Code/fluid_template/Fed_Page_layout_Page_897ff9ff5b584157401bff6428630f55cff8c500.php
> on line 56 and defined in
> /var/www/typo3_src-4.6.0/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
> line 219
>
> Apparently setRenderChildrenClosure() is called with a null value or
> missing parameter.
>
> When I look in the cached template I see this (snippet)
>
> // Rendering ViewHelper Tx_Fed_ViewHelpers_ScriptViewHelper
> $arguments4 = array();
> $arguments4['src'] = 'http://code.jquery.com/jquery-1.6.2.min.js';
> $arguments4['additionalAttributes'] = NULL;
> $arguments4['cache'] = false;
> $arguments4['concat'] = false;
> $arguments4['compress'] = false;
> $arguments4['index'] = -1;
>
> //here is $renderChildrenClosure5 defined
> $renderChildrenClosure5 = function() use ($renderingContext, $self) {
> return NULL;
> };
> $viewHelper6 = $self->getViewHelper('$viewHelper6', $renderingContext,
> 'Tx_Fed_ViewHelpers_ScriptViewHelper');
> $viewHelper6->setArguments($arguments4);
> $viewHelper6->setRenderingContext($renderingContext);
>
> //this is line 56 in error above
> $viewHelper6->setRenderChildrenClosure($renderChildrenClosure5);
> // End of ViewHelper Tx_Fed_ViewHelpers_ScriptViewHelper
>
>
>
> The setRenderChildrenClosure is defined as follow:
>
> /**
> * Called when being inside a cached template.
> *
> * @param Closure $renderChildrenClosure
> * @return void
> * @internal
> */
> public function setRenderChildrenClosure(Closure $renderChildrenClosure) {
> $this->renderChildrenClosure = $renderChildrenClosure;
> }
>
> Why is php/typo3/fluid complaining about $renderChildrenClosure5 is
> null, as you can see in the snippet above it is defined a few lines before.
>
> Tim
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev

Hi Tim,

if PHP is complaining about the variable being null then it most likely
is null.
I would assume that some call between the definition of
$renderChildrenClosure5 and its use has an impact on the value of
$renderChildrenClosure5. It should be pretty easy to determine when and
why the variable changes its value.

Greetings

Oliver



More information about the TYPO3-dev mailing list