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) »
  • Understanding smart group behavior and data schema
Pages: [1]

Author Topic: Understanding smart group behavior and data schema  (Read 1213 times)

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Understanding smart group behavior and data schema
December 05, 2011, 02:02:23 pm
I recently received a report of a smart group that caused a white screen. Turns out that, when I try to display the members of the smart group, PHP is running out of memory (we have 512MB allocated in php.ini, so I'm assuming that something else is going wrong to cause such a large consumption of memory).

This is a CiviCRM 3.4.4 site.

I looked up the smart group in the civicrm_group table (the one with id 29). The user defined description of the smart group is "Smart Group of individual donors (includes donors since 2008)". The civicrm_group table reports that this smart group has a saved_search_id of 7. So, I investigated the civicrm_saved_search table and I found that the where_clause field for the record with id 7 is:

Code: [Select]
( ( ( `civicrm_group_contact-29`.group_id IN ( 29 ) AND
 `civicrm_group_contact-29`.status IN ('Added') ) OR (
 `civicrm_group_contact_cache_29`.group_id = 29 ) ) )

The  other where_clause fields in the table seem to describe the user supplied criteria for the saved search, rather than referencing the group id.

Is this correct?

I mentioned this on IRC, and lobo mentioned that this bug has been reported and fixed. Eileen followed up, referencing this bug report:

http://issues.civicrm.org/jira/browse/CRM-9162

However, this group is not using ACLs, so I'm not sure that report is the one addressing this problem.

Any suggestions?

Thanks!

jamie

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: Understanding smart group behavior and data schema
December 05, 2011, 02:25:22 pm
can u create the same smart group and compare the civicrm_group and civicrm_saved_search columns

i suspect (and hope) they will have the right values.

If so, the question is how were the current values corrupted. Try doing an edit of the new group and see if that messes things up

this bug might be related:

http://issues.civicrm.org/jira/browse/CRM-9293

would be good if we can fix this bug soon, so we can release 3.4.8 :)

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

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Understanding smart group behavior and data schema
December 08, 2011, 09:05:32 am
Replicated at last...

http://issues.civicrm.org/jira/browse/CRM-9293?focusedCommentId=38704&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_38704

Thankfully I don't think civicrm is causing data corruption - it seems much more likely to be human error.

jamie

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: Understanding smart group behavior and data schema
December 08, 2011, 02:06:59 pm

seems like we should have a form rule that prevents someone from selecting itself in the search criteria / update search criteria

Can someone take a look and figure out a patch. I suspect doing this in the Saved Search Task is the easiest

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

kibbles

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal
  • MySQL version: Unknown
  • PHP version: Unkown
Re: Understanding smart group behavior and data schema
December 12, 2011, 04:34:20 pm
Thank you Donald and Jamie for figuring out this bug. 

Jamie, I think you gave a great explanation to my bug report (Smart Group Causes Fatal error: Out of memory, Unable to delete Smart Group).  I hope this bug can be fixed because it can be triggered quite easily by accident.  I was just trying to learn how to use smart groups when I ran into it. 

Does anyone know how to delete one of these self-referencing smart groups?  I am unable to delete the group without getting an error message.  Disabling the group does not fix the problem. 

Thanks for all the help!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Understanding smart group behavior and data schema

This forum was archived on 2017-11-26.