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

SuiteCRM cannot fix error in Smarty_Compliler.class.php

 
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
mrwrighty
Smarty n00b


Joined: 12 Jun 2015
Posts: 2

PostPosted: Fri Jun 12, 2015 3:07 pm    Post subject: SuiteCRM cannot fix error in Smarty_Compliler.class.php Reply with quote

Hi I'm using SuiteCRM and getting the following error on a server running PHP5.5:-

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/adgcrm/public_html/include/Smarty/Smarty_Compiler.class.php on line 268

I have edited the script according to suggestions on this site to this:-

$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "';")
, $source_content);

But I am still getting the same error. Any thoughts please.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Jun 13, 2015 6:01 pm    Post subject: Reply with quote

You must have edited not the Smarty_Compiler.class.php called by your application.
Back to top
View user's profile Send private message
mrwrighty
Smarty n00b


Joined: 12 Jun 2015
Posts: 2

PostPosted: Mon Jun 15, 2015 10:40 am    Post subject: Reply with quote

Yes I have, the file is shown in the path in the error in my original post.

/public_html/include/Smarty/Smarty_Compiler.class.php

Here is the surrounding code from the file

/* fetch all special blocks */
$search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s";

preg_match_all($search, $source_content, $match, PREG_SET_ORDER);
$this->_folded_blocks = $match;
reset($this->_folded_blocks);

/* replace special blocks by "{php}" */
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "';")
, $source_content);
/* Gather all template tags. */
preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
$template_tags = $_match[1];
/* Split content by template tags to obtain non-template content. */
$text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content);

/* loop through text blocks */
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Jun 15, 2015 9:47 pm    Post subject: Reply with quote

If you have caching enabled it's possible that the output of the error message is in your cache file. Empty the cache folder and try again.
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