CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • User being added then removed from group
Pages: [1]

Author Topic: User being added then removed from group  (Read 634 times)

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
User being added then removed from group
September 26, 2010, 12:06:44 am
I have a profile set up to be included in the Drupal user registration process that adds a user to a group.

For some reason tonight I was doing some testing and when a user registers it adds them to the group and then immediately removes them.

The group is an ACL group with User and User Admin Visibility. I do have a module installed that limits the viewing of ACL groups via hook. The code for that is below. Is it possible that module is interfering with the profile? If that's not doing it any ideas what else might be causing it? I'm running CiviCRM 3.2.3 and Drupal 6.x

Code: [Select]
function mycivimodule_civicrm_aclGroup( $type, $contactID, $tableName, &$allGroups, &$currentGroups ) {

    if ($tableName != 'civicrm_saved_search') {
        // this hook (according to the docs) also runs for events and profiles, but we only need it for groups
        return;
    }


    static $blockedGroupIds = array(1, 4, 6, 8);

    foreach ($blockedGroupIds as $groupId) {
        if ( FALSE !== $index = array_search($groupId, $currentGroups) ) {
            unset($currentGroups[$index]);
        }
    }

}

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: User being added then removed from group
September 26, 2010, 12:15:11 am
I think i just answered my own question. I hate when I do that LOL

I have the Civi Roles with Drupal sync set up. I think that's causing it. will report back when i find out.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: User being added then removed from group
September 26, 2010, 02:56:37 am
Yep that's what it was. I just had to go in and create a Triggered Rule to add a registered user to the Drupal Role and now all is well.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • User being added then removed from group

This forum was archived on 2017-11-26.