Idea: Profile syncronization with nodes

Events happening in the community are now at Drupal community events on www.drupal.org.
mgenovese's picture

I have been brainstorming the issue of user profiles, and the node profile solution for Drupal 5.x. What I have observed is that a number of modules already exist that leverage Drupal user profile data. So, I'm not particularly in favor of building a site that does not use profiles, as that limits the modules I might use that interact with profiles. But yet, the idea of using node profiles is compelling for similar reasons: Many modules exist that operate upon nodes, not the least of which are Views and CCK.

I know about the node profile module, and associated set of modules required to effectively replace profiles with nodes on a Drupal 5.x site. What I'm contemplating is a new module that stands on its own (not requiring any other module except CCK), and implements nodes that are synchronized profiles. Here's what I'm envisioning:

  1. A content type of the admin's choosing is created, and CCK is used to create fields. These fields mimic the fields already existing in Drupal user profiles.
  2. The new module (guided by the admin) creates a mapping, such that each profile field is mapped to a field in that content type.
  3. Now, the admin can instruct the module to create a single "profile node" for each existing user profile, with the individual profile fields for each user copied into each new node. For safety (to make sure we don't duplicate nodes), the existence of a profile node is checked before creating a new one for each user. This administrative action is presumed to happen only once by the admin after installation of this module.
  4. For every time afterwards that a user edits their profile, the corresponding profile node is automatically updated with that same information. For every new user, a new profile node is created with their profile.
  5. Any time a user is deleted, the corresponding node is also deleted. This is exactly like the usernode module. In fact, it may make sense to also use usernode as the node for which the profile fields are created & filled.

Now, there are some options here. One the one hand, we might decide to make each profile node uneditable, uncreatable, and undeletable by the associated user. This means that user profiles are the only means to update the information, and that the user cannot create new nodes of this "profile" content type. This is probably the easiest route.

Alternately, we might want to allow the profile nodes to be editable because we want to allow more info to be captured (beyond what can be captured in regular profiles) -- in other words, we want to allow additional CCK fields. The problem is that we don't want any profile information editable in the node, unless the module handles synchronizing any modified node information back to the profile. This may be easily do-able.

Has anyone consider this solution (or does this already exist)? Granted, it means we have more data stored in the DB (profiles + profile nodes), but I think a module that handles the mapping + synchronization is the easiest to integrate with all existing modules created for Drupal.

Requesting comments. Thanks for reading.

Matt

Comments

Maybe I should consolidate the idea

mgenovese's picture

I realize that I wrote a long description above to a relatively simple idea, so let me paraphrase what I said:

Idea: Use a module that synchronizes a "profile node" with a user's profile. Modify the profile, and the associated profile node is automatically updated. This approach allows all existing Drupal modules that use both regular profiles AND nodes to be leveraged for a given site.

Has this approach been considered before, and/or has it be done already (and I missed it)?

.

michelle's picture

It's not one I've ever seen. I wouldn't use such a module as I would rather adapt modules to use nodes for profiles. So far the only one I've run into, though, is the birthday module so it hasn't been a problem for me. If you write it, I'm sure you'll find people who want it.

Michelle


See my Drupal articles and tutorials or come check out the Coulee Region

Development

mgenovese's picture

I'm looking to have it developed by my team. But I'd love to get feedback from people who also have been brainstorming this problem. Again, the goal is to devise a solution that doesn't require the site owner to give up a slew of existing modules because either Drupal profiles or node_profile was chosen.

Off the top of my head, the Webforms module also makes use of profile information (for auto-filling profile info into fields).

Going from the node to profile

alex.k's picture

I was thinking to rather update the profile when editing a content_profile node, or implement the same profile.module API but using data from content_profile nodes. Of course, other modules using profile fields would check to see whether profile.module is installed before using its API. So this glue module would have to feign having a genuine profile module. Not sure if it's possible to ship within the distribution of one module another module that can be called 'profile' and implement the same interface that the real profile.module would.

Profiles as nodes

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week