I've got a module that uses hook_user to store some calculated info for the user as a serialized object.
Everything works fine except for $op == 'load', i.e., the form works, the data is validated, it's serialized, it's saved in the database properly and it's even unserialized properly for $op == 'form'.
In hook_user, if $op == 'load', I unserialize $account->myinfo and save it back as an object in $account->myinfo.
But, later, in my theme code looks at $account->myinfo and it is serialized (even though it was unserialized in mymodule_user during $op = 'load').
Somewhere in the middle of things it gets switched back (I did some following of the drupal code in PHpED and saw that it was fine for a while, but got bashed. I don't know drupal's internals well enough to find where it gets changed without going through each line of code.)
I also tried saving the object to the $edit argument (in $edit['myinfo']) in hook_user for $op='load'.
It sure seems like this should work.
Comments
Comment #1
sumgai commentedDing! Any comments on this?
I assume that changes to the $user object made in hook_user ($op='load') should persist and be available to theme functions?
Comment #2
sumgai commentedComment #3
nterbogt commentedSomething to think about:
http://drupal.org/node/57287
Comment #4
NROTC_Webmaster commentedIs this still an issue?
Comment #5
NROTC_Webmaster commented