Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.1.1
-
Fix Version/s: Unscheduled
-
Component/s: Core CiviCRM
-
Labels:None
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
OK - so there is a known occasional issue with circular smart groups. I managed to reproduce on demo by
1) creating a smart group
2) editing the criteria of the smart group to include the smart group itself.
After this the smart group gave a blank screen on demo (& does more destructive things on other sites depending on server config).
So, 2 levels of fix -
1) don't show the current group or any parent (or child?) groups on the smart group edit criteria screen
2) Apply Dave J's get out of jail free patch which does an early return when the smart group is resolved a second time & prevents recursion loops (this takes place where a hierarchy is in place - eg. multisite).
I'm happy with Dave's patch as being generally a good thing (albeit ambulance at the bottom of the cliff) & would like to go ahead & commit it - pref against 4.1.3 & we can keep the other part of this live for later. As a side issue I have been talking to Dave about the multi-site recursive resolution & whether it makes sense to resolve non-acl groups in this context.
— CRM/Contact/BAO/GroupContactCache.php.orig 2011-09-20 08:48:10.000000000 +0100
+++ CRM/Contact/BAO/GroupContactCache.php 2012-04-03 13:26:32.000000000 +0100
@@ -239,9 +239,15 @@
- load the smart group cache for a saved search
*/
static function load( &$group ) {
+ static $alreadyLoaded = array();
$groupID = $group->id;
$savedSearchID = $group->saved_search_id;
+ if (in_array($groupID, $alreadyLoaded))
{ + return; + }+ $alreadyLoaded[] = $groupID;
+
$sql = null;
$idName = 'id';
$customClass = null;
Attachments
Issue Links
- is supplemented by
-
CRM-16602 Stack of smart groups within smart groups within Parent groups
- Open