Just wondering if there was any workarounds allowing for segmentation data to be provided where a site is configured using node_profile instead of the profile module?

I know that this isn't supported out of the box (or at least as far as I can tell) - but - any way of attacking it?

Comments

hass’s picture

Could you please provide a patch?

chrissearle’s picture

I'd love to - but I think that may be beyond my coding skills in drupal right now :)

I can't help but feel that some kind of module that provides a node_profile <-> profile integration is a good idea for node_profile users since there are so many other things out there that connect to profile.

But I'm not sure of the work involved. 1 or 2 way sync? Hiding the profile fields from the user so that the only fill node_profile (or the other way). How to handle sync when a third party updates the profile fields etc.

hass’s picture

Category: support » feature
Priority: Normal » Minor
hass’s picture

Title: node_profile » node_profile and content_profile integration
hass’s picture

Version: 5.x-1.3 » 6.x-1.x-dev
hass’s picture

Title: node_profile and content_profile integration » nodeprofile and content_profile integration
hass’s picture

Title: nodeprofile and content_profile integration » API function for other modules
Project: Google Analytics » Content Profile
Priority: Minor » Normal

Moving to content_profile to get some attention.

hass’s picture

It would be good if there is we are able to invoke the module like the profile module and get the same result (this profile function extends the "user" object with data). See googleanalytics.module line 100ff.

Example:
$p = module_invoke('profile', 'load_profile', $user);

hass’s picture

Title: API function for other modules » Extend user object like profile module does
fago’s picture

Status: Active » Closed (won't fix)

there are API functions to access the profile nodes, then you can use API functions on the node or get the data from the node on your own. look at content_profile_load()
I don'T think that including the data into the user object is a good idea - it's bad for performance and doesn't provide anything helpful.

hass’s picture

content_profile_load load the full node and not only user data. load profile is only for loading user profile data and this is the standard core way. If this modules doesn't follow the core logic other modules cannot reuse the data.

nancydru’s picture

Component: Code » Base module

The RealName module uses content_profile_load to merge that data into the user object.

iva2k’s picture

subscribing

josepvalls’s picture

Priority: Normal » Minor
Status: Closed (won't fix) » Active

I came here from

http://drupal.org/node/654632
Seems that over there we agree that we may need some of the content profile information loaded into the $user object for segmentation but not ALL the information.
I'd like to add to the wish list, some kind of setting to check which fields to be loaded.

I will reopen the issue. I bet there are duplicates but I couldn't find them. I hope someone could comment on this.

Thanks!

hass’s picture

Only as a note, there may be a bug in GA, that need to get fixed for this feature. See http://drupal.org/node/679404#comment-2669392

fago’s picture

Status: Active » Closed (won't fix)

Reasons in #10 apply -> won't fix. If you really feel so strong about that, anyone is free to make a small module that does just so.

hass’s picture

Extending the user object is the way how object oriented code need to be written. Why are you so strong against clean API ways???

locomo’s picture

+1 on extending user object for use in other modules

in particular there is a need to be able to segment users in google analytics

henrijs.seso’s picture

Priority: Minor » Normal
Status: Closed (won't fix) » Active

#10 it's bad for performance...

How is calling content_profile_load() 30 times on each pageview is good for performance?

Or there is a way how to automatically redirect from user page to profile node or is content_profile_load results somehow cached?

nancydru’s picture

@mansspams: by the same light, explain how "calling profile_load_profile 30 times on each page view" is good for performance? And remember that a profile.module profile can easily consist of dozens of rows in the profile_values table. As I mentioned above, the RealName module does load content_profile data into the user object; as far as I can recall, no one has even complained about the performance of doing that. I personally, have noticed some extra queries occurring that I am working on clearing up, but adopters of the module have apparently not. BTW, I am static caching as much as possible so that "30 times" doesn't result in 30 queries.

henrijs.seso’s picture

All right.

Iv been using content profile for some year on 5 projects and all the time there is this extra step required - while building a rule, while configuring panels, while theming something, in views, everywhere I have to do extra step - load profile. It's just so unnatural that such important information as link to user profile is not in user object. But maybe its just me.

hass’s picture

Ähhm??? What are you talking about? First complaining about speed and than complain that the user object does not contain the data? It's technical the wrong way that the user object is not extended. This is the way how object oriented programming works. This may result in less performance if implemented wrong, but it have many if not uncountable benefits.

fago’s picture

Status: Active » Closed (won't fix)

>It's technical the wrong way that the user object is not extended. This is the way how object oriented programming works.
That's just wrong. It's the way it does not work.

>Or there is a way how to automatically redirect from user page to profile node or is content_profile_load results somehow cached?
Yes, it uses a static cache.

As said in #10, it won't happen.

hass’s picture

Status: Closed (won't fix) » Active

Can you explain why? There are benefits, but you ignore them or do not understand them. What have you not understood in object oriented programming?

fago’s picture

Status: Active » Closed (won't fix)

If it'd be possible I'd be fine with $user->profile() to get an instance of the profile, but we can't do that.

Anyway, we have the theme helper to simplify access to the profile nodes in themes + an API function. Just loading any linked profile for a user even if we don't know whether we are going to need it, would not only be unnecessary, but also it might become dangerous as we could easily run in an endless loop when another module loads the node author on a node load... -> No way.

Instead we could talk about improving it differently, perhaps by adding the theme helper to $account->profiles or similarly? I'm open for improvements, but just loading in the nodes is not the way to go.

hass’s picture

Status: Closed (won't fix) » Closed (duplicate)
ptoly’s picture

+1 for being able to extend an object, which is one of the fundamentals of OOP.