Answers.Body: <p>There was a bug that got introduced in the 5.10 series which broke these types of searches, i believe there was a patch release maybe 5.10.4 that fixed it but this is the specific fix <a href="https://github.com/civicrm/civicrm-core/pull/13667/commits/8966cd19d7897bdadc0588cab2c81df140759efc" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/13667/commits/8966cd19d7897bdadc0588cab2c81df140759efc</a> </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-09T17:14:10.210Z
Answers.Text: Thank you! Client decided to wait a bit before testing this but I will come back to confirm when we get to it.
Answers.UserDisplayName: freeform.steph
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-20T03:47:47.017Z
Answers.LastActivityDate: 2019-03-20T03:47:47.017Z
Answers.UserDisplayName: Seamus Lee
Body: <p>Let's say you have Group A &amp; Group B, and two contacts, Contact A and Contact B. We want our search to find those contacts who are in both Group A AND Group B.</p>
  
  <p>For example, if Contact A is in Group A only, but Contact B is in both groups, then the result of this search should be 'Contact B'.</p>
  
  <p>Search builder looks like:
  Contacts, Group(s) = Group A
  Contacts, Group(s) = Group B</p>
  
  <p>Result: no results.</p>
  
  <p>No errors are logged.</p>
  
  <p>We had several groups built on searches of this type, but after updating from 5.6.1 to 5.10.3 these all broke and began returning no results.</p>
  
  <p>I have tested this on the Demo site but could not reproduce - however the demo site is running 5.13.alpha1, so it's not a fair test. </p>
  
  <p>The release notes for 5.11.0 indicate some search fixes, but not anything that would make me assume this would also be resolved. I wasn't able to find anything in  Gitlab about this either. I'd rather not wait for 5.13 to be released so if someone could possibly point me to a specific patch that I could test in the meantime, that would be fantastic.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-11T23:09:44.673Z
Comments.Text: Is one group a smart group and the other static?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-12T15:40:28.680Z
Comments.Text: It's an attempt to make a smart group, and all of the referenced groups are also smart groups. I've tried multiple tests, and as soon as you add a second smart group to the criteria it stops returning results. I see now that all the groups on the demo site are manual, I am testing again using smart groups and will post back.
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-12T15:48:52.227Z
Comments.Text: Confirmed that this works with manual or smart groups on the demo site.
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-20T02:19:12.737Z
Comments.Text: I would definitely update to the latest released version before putting time into this one.
Comments.UserDisplayName: user4278
Tags: <search><search-builder>
Title: When using search builder to find contacts that are in multiple specific groups (AND, not OR), 0 results returned
ThreadText: # When using search builder to find contacts that are in multiple specific groups (AND, not OR), 0 results returned
  
  (Asked by: username_0 on 2019-03-11)
  
  Let's say you have Group A & Group B, and two contacts, Contact A and Contact B. We want our search to find those contacts who are in both Group A AND Group B.
  
  For example, if Contact A is in Group A only, but Contact B is in both groups, then the result of this search should be 'Contact B'.
  
  Search builder looks like:
  Contacts, Group(s) = Group A
  Contacts, Group(s) = Group B
  
  Result: no results.
  
  No errors are logged.
  
  We had several groups built on searches of this type, but after updating from 5.6.1 to 5.10.3 these all broke and began returning no results.
  
  I have tested this on the Demo site but could not reproduce - however the demo site is running 5.13.alpha1, so it's not a fair test.
  
  The release notes for 5.11.0 indicate some search fixes, but not anything that would make me assume this would also be resolved. I wasn't able to find anything in Gitlab about this either. I'd rather not wait for 5.13 to be released so if someone could possibly point me to a specific patch that I could test in the meantime, that would be fantastic.
  
  **Tags:** search, search-builder
  
  > **Comments:**
  > **username_1**: Is one group a smart group and the other static?  
  > **username_0**: It's an attempt to make a smart group, and all of the referenced groups are also smart groups. I've tried multiple tests, and as soon as you add a second smart group to the criteria it stops returning results. I see now that all the groups on the demo site are manual, I am testing again using smart groups and will post back.  
  > **username_0**: Confirmed that this works with manual or smart groups on the demo site.  
  > **username_2**: I would definitely update to the latest released version before putting time into this one.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-03-20. Score: 1
  
  There was a bug that got introduced in the 5.10 series which broke these types of searches, i believe there was a patch release maybe 5.10.4 that fixed it but this is the specific fix <https://github.com/civicrm/civicrm-core/pull/13667/commits/8966cd19d7897bdadc0588cab2c81df140759efc>
  
  > **Comments:**
  > **username_0**: Thank you! Client decided to wait a bit before testing this but I will come back to confirm when we get to it.  
  
  ---
  
  