Print

Warning call_user_func: First argument is expected to be a valid callback

What?
If you get something like the following error:

Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback in /home/.../templates/rt_affinity/rt_sectionrows.php on line 311

How?

  1. Copy & backup the file /public_html/.../templates/rt_affinity/rt_sectionrows.php
  2. Find the following piece of code around line 311:
    copyraw
    foreach($this->horizontalCookie[$row] as $block) {
    	$block = str_replace('-', '', $block);
    	$this->module_row1 .= call_user_func($block, $this, $mClasses);
    }
    1.  foreach($this->horizontalCookie[$row] as $block) { 
    2.      $block = str_replace('-', '', $block)
    3.      $this->module_row1 .= call_user_func($block, $this, $mClasses)
    4.  } 
  3. And change it to:
    copyraw
    foreach($this->horizontalCookie[$row] as $block) {
    	if(!empty($block)) {
    		$block = str_replace('-', '', $block);
    		$this->module_row1 .= call_user_func($block, $this, $mClasses);
    	}
    }
    1.  foreach($this->horizontalCookie[$row] as $block) { 
    2.      if(!empty($block)) { 
    3.          $block = str_replace('-', '', $block)
    4.          $this->module_row1 .= call_user_func($block, $this, $mClasses)
    5.      } 
    6.  } 
Category: Joomla :: Article: 451