Smarty Modifiers PHP

I am trying to get Smarty setup and working, so that I can install the open-source project here

http://sourceforge.net/projects/assign-calc/

After following the install instructions, I get stuck with the following error message

<b>Fatal error</b>:  Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template &quot;/var/www/dev/calendar/skins/rpc/tmpl/page/rpc_header.tpl&quot;  on line 5 &quot;         {$application.long_name|escape}&quot; unknown modifier &quot;escape&quot;' in /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php:423
Stack trace:
#0 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_compile_private_modifier.php(62): Smarty_Internal_TemplateCompilerBase-&gt;trigger_template_error('unknown modifie...', 5)
#1 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php(279): Smarty_Internal_Compile_Private_Modifier-&gt;compile(Array, Object(Smarty_Internal_SmartyTemplateCompiler), Array, NULL, NULL)
#2 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php(123): Smarty_Internal_TemplateCompilerBase-&gt;callTagCompiler('private_modifie...', Array, Array)
#3 /usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php(68): Smarty_Internal_TemplateCompilerBase in <b>/usr/lib/php5/Smarty/Smarty/sysplugins/smarty_internal_templatecompilerbase.php</b> on line <b>423</b><br />

After a bit of googling, I think the problem is being cause by Smarty not reading the escape modifier in the plugins directory.

How do I resolve this? I've even tried 777 the permissions on smarty, but that hasnt change anything...

Upvotes: 1

Views: 3332

Answers (3)

Michael Berkowski
Michael Berkowski

Reputation: 270707

I'm the developer of the Research Project Calculator, and found this SO question while researching the same problem for another user. The code has only been in the wild for a few weeks and we're discovering some of these things as other institutions install it.

I was able to get it running for the other user by explicitly calling parent::__construct(); before anything else in the inc/rpc_smarty.inc.php class constructor. I'll post a new release shortly, but for now you should just be able to patch that constructor as below.

Please feel free to contact me via the link in the project's installation instructions wiki page if you have more questions or run into other problems.

public function __construct($config)
{
   parent::__construct();
   $this->config = $config;
   ...
   ...
}

Upvotes: 1

joe
joe

Reputation: 69

An absolute system path is the fastest and safest approach. You can use relative paths, but be certain the php include_path contains what is needed to find it. You could also use SMARTY_DIR to base your path from.

Upvotes: 0

Nicol&#242; Martini
Nicol&#242; Martini

Reputation: 5220

Have you loaded the smarty configuration correctly? In particular, have you setted correctly the plugin path, through the command

$smarty->addPluginsDir('path/to/plugins');

?

Upvotes: 1

Related Questions