Until Joomla 1.6 beta 15, the JUser::save() function was using as
groups the definition of it:
/**
* Associative array of user group ids => names.
*
* @since 1.6
* @var array
*/
public $groups = array();
However now in SVN, this is not the case anymore.
It requires a numeric array of ids.
E.g.
$user->groups = array( 2 => 'Registered' );
$user->save();
works fine in Joomla 1.6 beta 1-15.
and now, in Joomla 1.6 SVN 19878, that does NOT work anymore: Joomla
now uses internally e.g. in backend user creation (simplified):
$user->groups = array( 0 => '2' );
$user->save();
But that doesn't work backwards with Joomla 1.6 beta, and additionally
is inconsistent with the result of:
JFactory::getUser( $this->id )->groups
is array( 2 => 'Registered' );
and the PHPdoc comment for var $groups still shows indexed array and
not numeric array.
As this breaks the Joomla API (and its use by Community Builder), I'm
posting in here as urgent request to clarify before Joomla 1.6 RC 1
release.
Many Thanks,
Beat
http://www.joomlapolis.com/