summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-06-17 14:40:48 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-06-17 14:40:48 -0400
commit11cc2b0251d705b5bed981368fee038e5dddb0d1 (patch)
tree86e749eaa69c0eb8c7de0a29c18b91bd637eb7d6 /includes
parentdc84091add715ca4abe4aa80fc32d27fe155ad4c (diff)
parent5cb79b4b217e9aa315d61284398cce132c28bea4 (diff)
downloadbrdo-11cc2b0251d705b5bed981368fee038e5dddb0d1.tar.gz
brdo-11cc2b0251d705b5bed981368fee038e5dddb0d1.tar.bz2
Merge tag '7.38' into 7.x
7.38 release Conflicts: CHANGELOG.txt includes/bootstrap.inc
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--includes/common.inc12
2 files changed, 11 insertions, 3 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 847bfc3a2..e2e133443 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -8,7 +8,7 @@
/**
* The current system version.
*/
-define('VERSION', '7.38-dev');
+define('VERSION', '7.39-dev');
/**
* Core API compatibility.
diff --git a/includes/common.inc b/includes/common.inc
index cd3014553..ceac115a5 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -6329,13 +6329,21 @@ function drupal_render_cid_parts($granularity = NULL) {
}
if (!empty($granularity)) {
+ $cache_per_role = $granularity & DRUPAL_CACHE_PER_ROLE;
+ $cache_per_user = $granularity & DRUPAL_CACHE_PER_USER;
+ // User 1 has special permissions outside of the role system, so when
+ // caching per role is requested, it should cache per user instead.
+ if ($user->uid == 1 && $cache_per_role) {
+ $cache_per_user = TRUE;
+ $cache_per_role = FALSE;
+ }
// 'PER_ROLE' and 'PER_USER' are mutually exclusive. 'PER_USER' can be a
// resource drag for sites with many users, so when a module is being
// equivocal, we favor the less expensive 'PER_ROLE' pattern.
- if ($granularity & DRUPAL_CACHE_PER_ROLE) {
+ if ($cache_per_role) {
$cid_parts[] = 'r.' . implode(',', array_keys($user->roles));
}
- elseif ($granularity & DRUPAL_CACHE_PER_USER) {
+ elseif ($cache_per_user) {
$cid_parts[] = "u.$user->uid";
}