When there are multiple profiles in use, get_variables() returns the same set of variables for both profiles. I believe this is down to the use of $this->_cache['type'] rather than $this->_cache[$type].
Attached patch fixes the problem.
Index: content_profile.theme_vars.inc
===================================================================
--- content_profile.theme_vars.inc (revision 713)
+++ content_profile.theme_vars.inc (working copy)
@@ -47,8 +47,8 @@
* or FALSE if there has been no profile created yet.
*/
function get_variables($type, $teaser = FALSE, $page = FALSE) {
- if (!isset($this->_cache['type'][$teaser][$page])) {
- $this->_cache['type'][$teaser][$page] = FALSE;
+ if (!isset($this->_cache[$type][$teaser][$page])) {
+ $this->_cache[$type][$teaser][$page] = FALSE;
if ($node = content_profile_load($type, $this->uid)) {
// Make sure the node is prepared for viewing
@@ -61,10 +61,10 @@
$function($vars, 'node');
}
}
- $this->_cache['type'][$teaser][$page] = $vars;
+ $this->_cache[$type][$teaser][$page] = $vars;
}
}
- return $this->_cache['type'][$teaser][$page];
+ return $this->_cache[$type][$teaser][$page];
}
/**
| Comment | File | Size | Author |
|---|---|---|---|
| content-profile-variable-cache.patch | 1023 bytes | mrfelton |
Comments
Comment #1
fagooh my, what happened here!? Thanks for catching that, committed.
Comment #3
marcp commented@fago - It'd be nice to get this into an official release soon. Thanks for maintaining content_profile!