Has anyone done any work toward loading nodeprofile data into the user object? The core profile module loads the profile fields into the user object, which allows the theme and other modules to take advantage of that data. It would be nice to do so with nodeprofile.

If no one has started work on this, I would gladly accept the task. I could build it as an external module, or as a patch to nodeprofile. Please advise. Thanks!

CommentFileSizeAuthor
#2 nodeprofile.user_load_op.patch-1.txt499 bytesjrbeeman

Comments

jrbeeman’s picture

Here is the structure I propose for loaded profile data:

$user->nodeprofile = array(
  'profile_content_type_2' => array(
    '#type' => 'profile_content_type_1',
    '#data' => node_load($nid_of_user_profile_content_type_1),
  ),
  'profile_content_type_2' => array(
    '#type' => 'profile_content_type_2',
    '#data' => node_load($nid_of_user_profile_content_type_2),
  ),
)
jrbeeman’s picture

StatusFileSize
new499 bytes

The attached patch loads nodeprofile data into the user object on the 'load' op of hook_user. The actual structure of the resulting user object should be:

$user->nodeprofile = array(
  'node_type1' => $node_object,
  'node_type2' => $node_object,
  ...
);
fago’s picture

Status: Active » Closed (won't fix)

As I've said already several times, I don't think that this is a good idea, so I won't do.

In short, I'm against it, because:
- it decreases performance
- it's possible to do the same easily without - just read the README about theming