summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-06-17 14:38:44 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-06-17 14:38:44 -0400
commit5cb79b4b217e9aa315d61284398cce132c28bea4 (patch)
treeff85c0695ee9db1178447fa29d7f76a3ff8e67f6 /includes
parent18c5da5028b7c3ba985e598bb8df45613285d437 (diff)
downloadbrdo-5cb79b4b217e9aa315d61284398cce132c28bea4.tar.gz
brdo-5cb79b4b217e9aa315d61284398cce132c28bea4.tar.bz2
Drupal 7.38
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 b572cde92..5eaa05e5f 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -8,7 +8,7 @@
/**
* The current system version.
*/
-define('VERSION', '7.37');
+define('VERSION', '7.38');
/**
* 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";
}