In profile2_load_by_user() function,

$cache = drupal_static(__FUNCTION__, array());

Should be :

$cache = &drupal_static(__FUNCTION__, array());

Otherwise $cache is always empty.

Comments

ericbroder’s picture

Status: Needs review » Needs work
StatusFileSize
new583 bytes

Seems correct that there should be an ampersand in front of drupal_static: http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/drupal...

Original patch doesn't apply for me though:

diff --git profile2.module profile2.module
index 06e7f98..8a8bfce 100644
--- profile2.module
+++ profile2.module
fatal: git diff header lacks filename information when removing 1 leading pathname components (line 5)

Attaching a new patch that hopefully is formatted better.

ericbroder’s picture

Status: Needs work » Needs review
jide’s picture

Hmmm weird that the patch did not apply for you, I used branches to create it. What command did you use to apply the patch ?

ericbroder’s picture

I pretty much tried to follow the instructions here: http://drupal.org/project/profile2/git-instructions

So ultimately the command I used was:
git apply -v [patchname.patch]

If you compare our two patches, you can see the only difference is "profile2.module" in yours versus "a/profile2.module" or "b/profile2.module" in mine.

Not sure why this is significant. I'm still learning git ;-)

jide’s picture

I use the branch methodology I describe here http://www.jide.fr/english/creating-git-patches because it works with drush make (and I find it a more natural workflow). This is discussed in http://drupal.org/node/1054616. Still learning GIT too though ;)

jide’s picture

BTW, patches done this way work with patch -p0 < file.patch.

fago’s picture

Status: Needs review » Fixed

thanks, committed.

fago’s picture

ouch, tests showed that more was broken as the static cache wasn't cleared correctly. fixed that.

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