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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Removing group membership
Pages: [1]

Author Topic: Removing group membership  (Read 1060 times)

kezzer

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Removing group membership
June 11, 2010, 07:08:12 am
Hi,

I accidentally added a lot of contacts to a group and then realised and removed them so that wasn't a problem. But now they all have listed on their groups page that they were once a member of this group - it's a bit irritating as it makes it confusing knowing who really was a member of this group and who was a mistake! Does anyone know how to remove this from someone's page?

Thank you  :)

Conga3.com

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 5
  • Should be golfing...
    • Conga3
Re: Removing group membership
June 13, 2010, 11:40:27 am
This is a good question.

Dropping the database records in the table "civicrm_group_contact" that have "status=Removed" might be all you have to do... but that record doesn't store the date of the Add/Remove, so there must be another record somewhere, and I hesitate to recommend you remove some records, without getting them all.

Someone round here will know better.

Hang tight buddy.


kezzer

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Removing group membership
June 14, 2010, 01:46:05 am
Thanks for this - the problem is that doing that would mean not seeing ANY groups that someone had been a part of and I want to see the proper ones!

Any other thoughts anyone?

Conga3.com

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 5
  • Should be golfing...
    • Conga3
Re: Removing group membership
June 14, 2010, 01:06:56 pm
If we can find where the REMOVED date is stored in the DB, then you could control which ones are removed.

Hmm......

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Removing group membership
June 14, 2010, 01:55:25 pm

civicrm_subscription_history

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Conga3.com

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 5
  • Should be golfing...
    • Conga3
Re: Removing group membership
June 14, 2010, 07:15:29 pm
And there it is!  Thanks Lobo.

So, create a script that finds the subscription changes in the date range you made the bad import (Added) and when you fixed your mistake (removed), and also remove the group_contact record that is linked with the FK.

kezzer

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Removing group membership
June 15, 2010, 03:41:04 am
Aaahhh, I'm a complete computer thicky and this means nothing to me!! Is there anyway of doing it without having to write a script?

Thank you all for your replies though  :)

Conga3.com

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 5
  • Should be golfing...
    • Conga3
Re: Removing group membership
June 15, 2010, 06:18:34 am
Two questions :

Can you access your database via phpMyAdmin, and are comfortable doing that, as well as creating/restoring a backup of the database?

How many mistakes are we talking about?  a few hundred?  a few thousand? more?

If you can't make a script, you could do it manually in phpMyAdmin, depending on how many records we are talking about...

But if you can't dig around in your database, I'm not sure how to help. If it's a big enough deal, hire a programmer to write a custom script to clean up your database for you.

--------------------------------

As a side discussion, this might be a low priority feature request for situations like this?  A mass update (add to group) is made in error, creating records that can't be fully undone by performing the opposite mass update(remove from group).  Is the subscription history the only record that this happens?   (Add to group / Remove from group -- Don't want the history to show the error)


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Removing group membership

This forum was archived on 2017-11-26.