Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Call of unknown method '_compile_source'.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
clj83
Smarty Regular


Joined: 16 Oct 2009
Posts: 44

PostPosted: Fri Nov 09, 2012 11:09 am    Post subject: Call of unknown method '_compile_source'. Reply with quote

Hopefully someone can help me with this. I am using smarty within CMSMS and have something called a User Defined Tag running within my page. This contains the following code:

Code:
$db = cmsms()->GetDb();
$menu = $smarty->get_template_vars('page');
$user_id = $smarty->get_template_vars('userid');
if (!isset($user_id)) {
  $user_id = -1;
}

// Getting menu items from DB
$query = 'SELECT * FROM '. cms_db_prefix() .'module_tools_options
 WHERE active = 1 AND user_id = ? AND menu = ?
 ORDER BY sort';
$dbresult = $db->Execute($query, array($user_id, $menu));

while ($dbresult && $row = $dbresult->FetchRow()) {
$smarty->_compile_source('preprocess template', $row['title'], $_compiled);
@ob_start();
$smarty->_eval('?>' . $_compiled);
$result = @ob_get_contents();
@ob_end_clean();
   echo '<li id="menu_' . $row['option_id'] . '">' . $result . "</li>\n";
}


I have upgraded the CMSMS installation so it now runs smarty 3 and this has broken my page. I get the following error:

/lib/smarty/sysplugins/smarty_internal_templatebase.php:

Call of unknown method '_compile_source'.

I guess the Compile Source method has been depreciated in Smarty 3. Can anyone point me in the right direction of its replacement or a method to get this working again?

Many Thanks
Back to top
View user's profile Send private message
cbj4074
Smarty Regular


Joined: 10 Nov 2011
Posts: 49

PostPosted: Mon Nov 12, 2012 8:35 pm    Post subject: Reply with quote

Have you emptied your template compile directory (e.g., "templates/templates_c")?

I have found that it is often necessary to empty this directory when Smarty is upgraded, otherwise unexpected errors can occur.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP