[Fixed]$smarty->_current_file

Post Reply
Jean le Chauve

[Fixed]$smarty->_current_file

Post by Jean le Chauve »

The value content:content_en in the variable $smarty->_current_file is now a string like d540fdf18880c4e881dd92fd9e7dc05ee28f9ea8
However, other values (globalcontent:***, content:pagedata...) still ok.

So, in the pre and post filters, the case "content" never happens.

Code: Select all

function smarty_prefilter_precompilefunc($tpl_output, &$template)
{
  $smarty = $template->smarty;
	$result = explode(':', $smarty->_current_file);
	if (count($result) > 1)
	{
	  if( startswith($result[0],'tmp_') ) $result[0] = 'template';

		switch ($result[0])
		{
		case 'stylesheet':
		  Events::SendEvent('Core','StylesheetPreCompile',array('stylesheet'=>&$tpl_output));
		  break;

			case "content":
				Events::SendEvent('Core', 'ContentPreCompile', array('content' => &$tpl_output));
				break;

		case 'tpl_top':
		case 'tpl_body':
		case 'tpl_head':
		case "template":
		  Events::SendEvent('Core', 'TemplatePreCompile', array('template' => &$tpl_output,'type'=>$result[0]));
		  break;

			case "globalcontent":
				Events::SendEvent('Core', 'GlobalContentPreCompile', array('global_content' => &$tpl_output));
				break;
			default:
				break;
		}

	}

	Events::SendEvent('Core', 'SmartyPreCompile', array('content' => &$tpl_output));

	return $tpl_output;
}
?>
Last edited by Jean le Chauve on Thu Jul 26, 2012 7:09 pm, edited 4 times in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: $smarty->_current_file

Post by calguy1000 »

gach, okay I'll look into it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: $smarty->_current_file

Post by calguy1000 »

Fixed in svn.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Jean le Chauve

Re: $smarty->_current_file

Post by Jean le Chauve »

Great :)
Thank you

Sorry, if it's fixed for content_en, it still an other problem : evaluated template have the same bug ; it's value is a string like 49827e17aaeb246267be171d8e993eb407af77bf
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [Fixed but]$smarty->_current_file

Post by calguy1000 »

evaluated templates are evaluated as strings... not much we can do about that.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Jean le Chauve

Re: [Fixed but]$smarty->_current_file

Post by Jean le Chauve »

Ok, Thank you for your answer.
This post is fixed.
Post Reply

Return to “Closed Issues”