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];
   }
 
   /**
CommentFileSizeAuthor
content-profile-variable-cache.patch1023 bytesmrfelton

Comments

fago’s picture

Status: Active » Fixed

oh my, what happened here!? Thanks for catching that, committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

marcp’s picture

@fago - It'd be nice to get this into an official release soon. Thanks for maintaining content_profile!