Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.0
-
Fix Version/s: 4.1.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
The function CRM_Core_Permission_Drupal::group() returns a list of all groups which the current drupal user has permission to see, filtered by a groupType parameter. The function will cache the results, but does so without differentiating between different group types. The result is that if two calls to the same function are made with during the same request, the results from the first call will always be cached and returned from the second call, even if the requested group type is similar.
The attached patch caches the results into a hashed array, using the groupType as a key. The cache is then only used if the value for the specified group type exists in cache.
this patch only addresses the issue in the Drupal permission object; it is possible the same issue exists in the Joomla or standalone versions, but I cannot test those. Would probably be a good idea to have someone with Joomla/Standalone smarts check it out.