diff --git a/Makefile b/Makefile index 3b969d8a5c0acaaffbd580cf7d0f54c9b2179bdd..3e1dd6d390e12e499c8d46afdcbcc15ef0c51e8b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ BASE=usergroupsfield PLUGINTYPE=plug ZIPBASE=opentools_cb2 -VERSION=2.0.0 +VERSION=2.0.1 PLUGINFILES=cb.$(BASE).php cb.$(BASE).xml diff --git a/cb.usergroupsfield.php b/cb.usergroupsfield.php index a7cf1b370e85f61ad5ab911cb36f60781c8fcb8d..af442a209b9dcd61c8d89f7de2a27b6eb61a5b41 100644 --- a/cb.usergroupsfield.php +++ b/cb.usergroupsfield.php @@ -126,6 +126,16 @@ class CBfield_usergroups extends cbFieldHandler { $lang->load( 'com_users' ); } $gids = $user->gids; + if (empty($gids)) { + // Load the user groups from the database, because in list view the gids are NOT loaded! + // This is from CB\Database\Table\UserTable::afterBindFromDatabase, + // which is documented as WIP and not adviced to be called directly, + // so we duplicate the code here... + $gids = array_values( (array) \JFactory::getAcl()->getGroupsByUser( $this->id, false ) ); + foreach ( $gids as $k => $v ) { + $gids[$k] = (string) $v; + } + } $allgroups = $this->getUserGroupsMap(); $restrictedgroups = $this->_explodeCBvalues($field->params->get('usergroups', '')); $restrict = $field->params->get('restrict_display_selected', 1); diff --git a/cb.usergroupsfield.xml b/cb.usergroupsfield.xml index a12c4482b28d13e6649693720c8bbe7bc0ab242f..089176b0a840ad4e4f5d251c4ee03494b6b5d875 100644 --- a/cb.usergroupsfield.xml +++ b/cb.usergroupsfield.xml @@ -7,7 +7,7 @@ <license>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 2 or later</license> <authorEmail>office@open-tools.net</authorEmail> <authorUrl>www.open-tools.net</authorUrl> - <version>2.0.0</version> + <version>2.0.1</version> <description> A Community Builder field plugin that displays the Joomla groups in the profile and lets administrator modify the groups in the profile. </description> @@ -45,4 +45,4 @@ </uninstall> <database> </database> -</cbinstall> +</cbinstall> diff --git a/images/plug_usergroupsfield_usage3.png~ b/images/plug_usergroupsfield_usage3.png~ deleted file mode 100644 index 8891810782264b4ba222b5e4455639f2f7e7accc..0000000000000000000000000000000000000000 Binary files a/images/plug_usergroupsfield_usage3.png~ and /dev/null differ diff --git a/releases/plug_opentools_cb2_usergroupsfield_v2.0.1.zip b/releases/plug_opentools_cb2_usergroupsfield_v2.0.1.zip new file mode 100644 index 0000000000000000000000000000000000000000..295e4d606f7fb2248dbb39948a80cf0e72fd43e5 Binary files /dev/null and b/releases/plug_opentools_cb2_usergroupsfield_v2.0.1.zip differ