[k2 fix] Fatal error: Call to undefined function mb_regex_encoding

Rate this item
(0 votes)
Sunday, 08 September 2013 17:49;
Published in Joomla Tutorials;
If you have recently installed K2 on a Joomla website and getting a blank page, its due to some PHP errors. If order to see those error, make sure you have the ERROR REPORTING set to MAXIMUM on your Global Configuration tab.
Once that is done, you may refresh your K2 item page and see the error codes.
Mostly its due to this error,
"Fatal error: Call to undefined function mb_regex_encoding()"
And here is how to fix this, The affected files are "k2category.php" and "k2item.php" in .../administrator/components/com_k2/tables/ and "route.php" in .../components/com_k2/helpers/. Modifications - commenting out the lines with mb_regex and mb_ereg... as shown... @ route.php, find this:
mb_internal_encoding("UTF-8"); 
// mb_regex_encoding("UTF-8"); 
$alias = trim(mb_strtolower($user->name)); 
$alias = str_replace('-', ' ', $alias); 
// $alias = mb_ereg_replace('[:space:]]+', ' ', $alias); 
@ k2category.php, find this:
mb_internal_encoding("UTF-8"); 
// mb_regex_encoding("UTF-8"); 
$this->alias = trim(mb_strtolower($this->alias)); 
$this->alias = str_replace('-', ' ', $this->alias); 
// $this->alias = mb_ereg_replace('[:space:]]+', ' ', $this->alias); 
@ k2item.php, find this:
mb_internal_encoding("UTF-8"); 
// mb_regex_encoding("UTF-8"); 
$this->alias = trim(mb_strtolower($this->alias)); 
$this->alias = str_replace('-', ' ', $this->alias); 
// $this->alias = mb_ereg_replace('[:space:]]+', ' ', $this->alias); 
Read 3094 times Last modified on Saturday, 14 December 2013 04:37
comments powered by Disqus

We are on Facebook

Tutorials Search