Warning: Invalid argument supplied for foreach() in /public_html/components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php on line 240

W

How Can We Help?

Warning: Invalid argument supplied for foreach() in /public_html/components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php on line 240

If you get the error message Warning: Invalid argument supplied for foreach() in /public_html/components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php on line 240 when using Community Builder together with Fireboard and clicking on My Profile and also receive weird descriptions in the form (missing language file) and need to fix it, follow the short steps below to solve the problem.

 

Error

 

STEP 1

To solve the language issue, locate the language file and add the following lines at the bottom of the file and save it and upload it. (/components/com_comprofiler/plugin/language/YOURLANG/YOURLANG.php)

DEFINE(‘_UE_USER_FAVS’,’Your favorite’);
DEFINE(‘_UE_THREAD_UNFAV’,’:: Remove favorite ::’);
DEFINE(‘_UE_USER_NOFAV’,’No favorites found for you’);
DEFINE(‘_UE_USER_UNFAV_ALL’,’Remove all your favorites’);
DEFINE(‘_UE_fb_CONFIRMUNFAVEALL’,’Confirmation removal’);
DEFINE(‘_UE_FB_TABTITLE’,’Forum Settings’);
DEFINE(‘_UE_FB_TABDESC’,’Description’);
DEFINE(‘_UE_FB_VIEWTYPE_TITLE’,’View type’);
DEFINE(‘_UE_FB_ORDERING_TITLE’,’Ordering’);
DEFINE(‘_UE_FB_SIGNATURE’,’Signature’);
DEFINE(‘_UE_FB_VIEWTYPE_FLAT’,’Flat View’);
DEFINE(‘_UE_FB_VIEWTYPE_THREADED’,’Threaded View’);
DEFINE(‘_UE_FB_ORDERING_OLDEST’,’Oldest First’);
DEFINE(‘_UE_FB_ORDERING_LATEST’,’Latest First’);

Refresh your page and the language problem will be sovled.

STEP 2

To solve the Warning: Invalid argument supplied for foreach() in /public_html/components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php on line 240 problem locate the cb.cb_core.php file and edit it as described below.

On about line 475 comment the following lines out

 /*
//Implementing Joomla’s new user parameters such as editor
$userParams = array();
$userParams = $this->_getUserParams($ui, $user);

if ( ( count( $userParams ) > 0 ) && in_array( $_CB_framework->getCfg( “frontend_userparams”
), array( ‘1’, null) ) ) {
//Loop through each parameter and render it appropriately.
foreach($userParams AS $userParam) {
$return .= “<tr>\n”;
$return .= “<td class=\”titleCell\”>” . $userParam[0] . “:</td>\n”;
$return .= “<td class=\”fieldCell\”>” . $userParam[1];
$return .= getFieldIcons($ui, false, false, (isset($userParam[2]) && class_exists(”
JText”) ? JText::_($userParam[2]) : null), (isset($userParam[3]) && class_exists(“JText”) ? JText::
_($userParam[3]) : null));
$return .= “</td></tr>\n”;
}
}
*/

 

After you’ve commented those lines out. Remove the following line $params->loadSetupFile(JApplicationHelper::getPath( ‘com_xml’, ‘com_users’ )); in the cb.cb_core.php file.

Change line $params =& $juser->getParameters(); to $params =& $juser->getParameters(true);

Save the file and upload it.

Refresh your page and the error message should be gone and problem solved.

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me