Closed (duplicate)
Project:
Content Profile
Version:
6.x-1.x-dev
Component:
Base module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Jan 2008 at 22:16 UTC
Updated:
28 Aug 2010 at 22:47 UTC
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
Comment #1
hass commentedCould you please provide a patch?
Comment #2
chrissearle commentedI'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.
Comment #3
hass commentedComment #4
hass commentedComment #5
hass commentedComment #6
hass commentedComment #7
hass commentedMoving to content_profile to get some attention.
Comment #8
hass commentedIt 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);Comment #9
hass commentedComment #10
fagothere 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.
Comment #11
hass commentedcontent_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.
Comment #12
nancydruThe RealName module uses content_profile_load to merge that data into the user object.
Comment #13
iva2k commentedsubscribing
Comment #14
josepvalls commentedI 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!
Comment #15
hass commentedOnly 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
Comment #16
fagoReasons 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.
Comment #17
hass commentedExtending the user object is the way how object oriented code need to be written. Why are you so strong against clean API ways???
Comment #18
locomo commented+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
Comment #19
henrijs.seso commented#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?
Comment #20
nancydru@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.
Comment #21
henrijs.seso commentedAll 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.
Comment #22
hass commentedÄ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.
Comment #23
fago>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.
Comment #24
hass commentedCan you explain why? There are benefits, but you ignore them or do not understand them. What have you not understood in object oriented programming?
Comment #25
fagoIf 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.
Comment #26
hass commented#654632: Compatibility with Google Analytics' advanced segmentation
Comment #27
ptoly commented+1 for being able to extend an object, which is one of the fundamentals of OOP.