Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument 3 passed to Smarty_Internal_Runtime_FilterHandler::runFilter() must be an instance of Smarty_Internal_Template, null given #144

Closed
ScuzzyAyanami opened this issue Dec 24, 2015 · 2 comments

Comments

@ScuzzyAyanami
Copy link

Using Smarty 3.1.29 I'm getting the following error when setting this code up in the demo folder.

Catchable fatal error: Argument 3 passed to Smarty_Internal_Runtime_FilterHandler::runFilter() must be an instance of Smarty_Internal_Template, null given, called in C:\WebRoot\smarty.3.1.29\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 429 and defined in C:\WebRoot\smarty.3.1.29\libs\sysplugins\smarty_internal_runtime_filterhandler.php on line 33

I was originally on 3.1.21 and it seems like ~3.1.28 introduced this error.

Commenting/Un-Commenting out the loadFilter() call throws the error or not

demo/index.php

<?php
require '../libs/Smarty.class.php';
$smarty = new Smarty;
$smarty->force_compile = true;
$smarty->debugging = true;
$smarty->caching = false;
$smarty->cache_lifetime = 120;
$smarty->setPluginsDir(array('./plugins','../libs/plugins'));
$smarty->loadFilter('post','donothingatall');
$smarty->display('index.tpl');

demo/plugins/postfilter.donothingatall.php

<?php
function smarty_postfilter_donothingatall($compiled, Smarty_Internal_Template $template)
{
  return $compiled;
}

demo/templates/index.tpl

{extends file="parent.tpl"}

demo/templates/parent.tpl

{block name="blockety"}one block{/block}
  • {main}( )
  • Smarty_Internal_TemplateBase->display( )
  • Smarty_Internal_TemplateBase->_execute( )
  • Smarty_Internal_Template->render( )
  • Smarty_Template_Compiled->render( )
  • Smarty_Template_Resource_Base->getRenderedTemplateCode( )
  • content_567b6c278c4589_43441721( )
  • Smarty_Internal_Runtime_SubTemplate->render( )
  • Smarty_Internal_Template->render( )
  • Smarty_Template_Compiled->render( )
  • Smarty_Template_Compiled->process( )
  • Smarty_Template_Compiled->compileTemplateSource( )
  • Smarty_Internal_TemplateCompilerBase->compileTemplate( )
  • Smarty_Internal_TemplateCompilerBase->postFilter( )
  • Smarty_Internal_Runtime_FilterHandler->runFilter( )
@uwetews
Copy link
Contributor

uwetews commented Dec 24, 2015

The fix is now in the master branch and will later be included in 3.1.30

@uwetews uwetews closed this as completed Dec 24, 2015
uwetews added a commit to smarty-php/smarty-phpunit that referenced this issue Dec 24, 2015
@JayBizzle
Copy link

Any ETA on the 3.1.30 release? This bug is causing me issues

wisskid pushed a commit that referenced this issue Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants