Joomla! Discussion Forums



It is currently Sun Nov 22, 2009 3:42 am (All times are UTC )

 





Post new topic Reply to topic  [ 5 posts ] 
Author Message
Posted: Mon Oct 15, 2007 11:47 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Mon Oct 15, 2007 11:38 pm
Posts: 2
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.

Top
   
 
Posted: Tue Oct 16, 2007 12:59 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 8:53 am
Posts: 711
Location: Switzerland
Thanks for reporting it here. This is the CB code which worked in RC2, and doesn't work anymore in RC3:

Code:
<?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


Top
  E-mail  
 
Posted: Tue Oct 16, 2007 11:53 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
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.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Tue Oct 16, 2007 3:07 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Mon Oct 15, 2007 11:38 pm
Posts: 2
Thanks Jinx!  That works great  :D


Top
   
 
Posted: Tue Oct 16, 2007 6:52 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
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.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group