[RESOLVED]RC3 breaks user parameters in Community Builder 1.1

Locked
peajayess
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Oct 15, 2007 11:38 pm

[RESOLVED]RC3 breaks user parameters in Community Builder 1.1

Post by peajayess » Mon Oct 15, 2007 11:47 pm

Using RC3 and Community Builder 1.1, in the CB Details, Edit->Update Your Profile, the following error appears.

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


This problem has been reported on the CB forum here.

http://www.joomlapolis.com/component/op ... /catid,43/

CB devs claim RC3 changed the user parameters API, and to report it as a bug here.

Please forgive me if this is a duplicate.  Tried searching for "com_comprofiler/plugin/user/plug_cbcore/cb.core.php on line 240" here and on google, and only found is reported on the CB forum so far.
Last edited by Jinx on Tue Oct 16, 2007 7:03 pm, edited 1 time in total.

User avatar
Beat
Joomla! Guru
Joomla! Guru
Posts: 840
Joined: Thu Aug 18, 2005 8:53 am
Location: Switzerland
Contact:

Re: RC3 breaks user parameters in Community Builder 1.1

Post by Beat » Tue Oct 16, 2007 12:59 am

Thanks for reporting it here. This is the CB code which worked in RC2, and doesn't work anymore in RC3:

Code: Select all

<?php
		if (class_exists("JUser")) {						// Joomla 1.5 :
			$juser =& JUser::getInstance($user->id);
			$params =& $juser->getParameters();
			$params->loadSetupFile(JApplicationHelper::getPath( 'com_xml', 'com_users' ));
			// $result = $params->render( 'params' );
			if (is_callable(array("JParameter","getParams"))) {
				$result = $params->getParams( $name );	//BBB new API submited to Jinx 17.4.2006.
			} else {
...
the resulting foreach error is because $result  above is not an array as a result of the above function.

Steps to reproduce: install CB 1.1, and edit an user.

As RC3 didn't go through ex-Q&T WG, we couldn't test and catch that API change before 1.5 RC3 got released. Is it possible to fix that for RC4 ?

Thanks,
Beat 8)
www.joomlapolis.com <= Community Builder + CBSubs Joomla membership payment system - team
hosting.joomlapolis.com <= Joomla! Hosting, by the CB Team

User avatar
Jinx
Joomla! Champion
Joomla! Champion
Posts: 6569
Joined: Fri Aug 12, 2005 12:47 am
Contact:

Re: RC3 breaks user parameters in Community Builder 1.1

Post by Jinx » Tue Oct 16, 2007 11:53 am

Beat,

The quick fix is removing this line :
$params->loadSetupFile(JApplicationHelper::getPath( 'com_xml', 'com_users' ));

and changing this : $params =& $juser->getParameters();
to                      : $params =& $juser->getParameters(true);

The JUser API now autoloads the params xml file. This was explained on the developer list a while ago. You might have missed that.

Cheers,

Johan
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.joomlatools.com - Joomla extensions that just work

peajayess
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Oct 15, 2007 11:38 pm

Re: RC3 breaks user parameters in Community Builder 1.1

Post by peajayess » Tue Oct 16, 2007 3:07 pm

Thanks Jinx!  That works great  :D

User avatar
Jinx
Joomla! Champion
Joomla! Champion
Posts: 6569
Joined: Fri Aug 12, 2005 12:47 am
Contact:

Re: [RESOLVED]RC3 breaks user parameters in Community Builder 1.1

Post by Jinx » Tue Oct 16, 2007 6:52 pm

The good news is also that you can give the getParameters function a path to load the xml file for each usertype. This give you alot of extra flexibility, for example, you can let it load your own xml files. If you have any question have the extra flexibility in JUser just put them on the 1.5 dev forum and i'll do my best to explain.
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.joomlatools.com - Joomla extensions that just work


Locked

Return to “Q&T 1.5.x Resolved”