Fix filtering when using a smart group #30
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was testing this extension with a client site what I found was that when I was using a smart group as the include group it is possible that results weren't able to found because it was joining to the wrong table.
civicrm_group_contact is used for static group and manually added contacts to groups. However when the smart group cache is populated those contacts are also added to the cache table. The cache table also doesn't have a status field as it is limited to just contacts that are in the group
Also I know of at least one site that has dropped the id auto increment column from the cache tables so this handles that situation as well.