| Project: | Content Profile |
| Version: | 6.x-1.x-dev |
| Component: | Base module |
| Category: | task |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I apologize if this is a dupe. Searching on "D7" or "7.x" is not allowed and "core" turned up nothing useful.
With users being fieldable objects in D7, it seems to finally make sense for most folks to drop the nodes as profiles route. There are still some cases to be made for having them be nodes but the biggest, using CCK with them, is no longer a reason. Folks starting with D7 will likely choose the pure fields route but those of us upgrading from D6 have a decision to make.
I'm wondering what you, as the maintainer of the key profile as nodes module, have planned for D7? Are you intending to port Content Profile as is and continue down the profile as nodes route? Or are you planning on writing a converter to core fields?
To be clear, I don't expect work on anything to be starting now. :) I'm just wondering about your plans, if any, so I can make plans of my own. This might be a good thing to document on the project page as well since it's hard to search on.
Thanks,
Michelle
Comments
#1
subscribing
#2
i am interested to hear fago's position as well. I for one intend to continue using nodes as profiles since I need profiles to support drupal's native comments and moreover in some cases I will be needing my users to maintain more than one profile which is a no-go with the user-as-profile solution.
#3
I'm in the opposite camp. I don't use the comments on the nodes since I (currently) use guestbook and will be moving to FBSS for that. I don't use multiple nodes per user but rather use fieldsets on a single node. There's really nothing in what I do that needs profiles to be nodes except for wanting to use CCK, which is moot in D7. So I'd like to convert but I don't know enough about CCK / FieldAPI to write a converter.
Michelle
#4
This would indeed be interesting to know. Just like Michelle, I just use content_profile to extend the Profile page with CCK.
I guess a decision would depend on the outcome of those issues though:
http://drupal.org/node/394720
http://drupal.org/node/501408
http://drupal.org/node/516138
#5
Ideally I do think profiles in d7 are separate entities - I think that's conceptually right and personally I don't care much about comments either.
See http://drupal.org/node/394720#comment-2022166 for more about that.
#6
I went back and forth on this for a long time and finally decided it makes more sense to convert now, in D6. In particular:
1) The fields available in Content Profile are much more flexible and useful. You can choose how to format the results and there are lots more types of fields and settings options.
2) Some fields just don't work well in Views as profile fields. One of these is the date field, which is stored as a serialized array by the core profile module. That means you can't sort or filter by that value in Views. So the only useful way to have a date field in Views is if it is a CCK field.
3) If you convert in D6, you will go into D7 with regular CCK fields, which will automatically get the same upgrade processing that all other CCK fields get. If you don't, you'll be part of a smaller group of users using a different upgrade path that may not be as well tested or as widely used.
So I'm converting now.
I created a new module at http://drupal.org/project/profile_migrate. It's brand new and needs testing, but if you want to protect yourself with backups and do some testing you can try it out and help test it.
#7
Cool! I added a link to profile migrate on the project page.
I also added a note about the relationship to content profile on the profile2 project page: http://drupal.org/project/profile2
The upgrade path from content profile to profile2 shouldn't be hard, but probably we should keep the nodes wrapping the profile2 entities - thus it would make sense to have content profile in drupal 7 for using nodes to wrap profile2 entities. People don't needing nodes could disable content profile2 after the upgrade. Opinions on that?
Certainly I could also need help, in particular with the upgrade and nodes-as-wrapper parts.
#8
subscribing
#9
subscribe
#10
subscribing
#11
Subscribing
#12
sub
Unrelated, but I am trying to find an upgrade path from usernode in D5 to content-profile in D6
#13
I would like to confirm that if I still want my user's profiles to be nodes then I will need Profile2 module as well as Content Profile module in Drupal 7?
#14
+1 subscribing
any plans for this in the near future?
#15
subscribing
#16
Tracking.
#17
Subscribing.
#18
sub.
#19
+1 follower
#20
Subscribing.
#21
Subscribing...
#22
Any idea whey we can expect a first d7 release?
#23
sub and +1 on making this a 'wrapper' for Profile2
#24
subscribing
#25
tracking
#26
Using Content Profile as a node-based wrapper for Profile 2 makes sense to me.
#27
subscribing.
My sites have lots of profiles, but few users; so I prefer a separate Content Profile, rather then an updated user.profile.
#28
subscribe
#29
Looks like I've to concentrate on profile2 for d7. Anyone wants to take over D7 development + maintenance? -> Contact me.
#30
As long as there's a way to convert existing profiles, I'd be moving to profile2. So not me, sorry.
Michelle
#31
subscribe
#32
subscribe
#33
Subscribing
#34
Subscribing
#35
Subscribing
#36
Subscribing
#37
sub.
#38
I am planning to upgrade one of the sites, which currently is using core profile module, from D6 to D7. I'd like the website to continue using core profile module, but not the one from D6, which is hidden and can be activated in D7 too, but the new one, which makes users fieldable objects. As I understand simple unhiding and activating the core profile module from D6 will not automatically convert user profiles to D7's new approach. So my question is what is the best way to make this transition:
1) Converting to Content Profile while in D6 and upgrading the website to D7. Can Content profiles in this case easily turned into fieldable user objects in D7? Or we have to first convert Content Profiles to Profile2 and then migrate to core profile module of D7?
or
2) Upgrading the website to D7, activating hidden profile module from D6 and dealing with converting it to core profile module for D7?
Could someone enlighten this confusion for me to avoid extra unnecessary steps, please?
#39
@yngens: I don't know if a clear upgrade path has been outlined yet, for either Content Profile or D6 Profile module to either D7 user fields or Profile2 fields.
If the patch to allow D7 user fields to show during user registration gets committed, I think it might be possible for you to use "straight up" D7 user fields, without worrying about Profile2, unless you need more complex functionality.
If you upgrade to D7, core Profile module will not be hidden for you, since you have data. It is only hidden for people who are doing a fresh install of D7, or upgrading a D6 site without profile data.
If I were in your situation, I would probably upgrade to D7 and then create the profile fields as user fields, unless there are too many of them to create manually. Then I would write a script or a module to migrate the data, probably by using the API rather than straight SQL. But I would probably wait until the patch to allow the user fields to show in registration is committed.
#40
EvanDonovan, thanks for suggestion, I'll wait till some kind of safe path is available.
#41
sub
#42
subscribe
#43
Subscribing.
#44
Subscribing...
#45
Keep me updated.
#46
Subscribe
I'm currently upgrading from Drupal 5 to Drupal 6. No Content Profile installed yet but I was looking into it. Not migrating to Drupal 7 for at least a year. Guess we'll have plain vanilla profiles unless there is an upgrade path.
#47
Subscribing.
#48
subscribing
#49
Michelle, did you ever find a converter or perhaps a snippet to use with VBO?
I am also interested in converting to the core profile before moving to D7.
#50
No. I'm a long way from using D7 so haven't looked into this, yet.
Michelle
#51
Subscribe
#52
+
#53
Subscribing.
#54
subscribing
#55
subscribe
#56
Changed title to make module name visible in Dashboard.
#57
subscribing
#58
Subscribing
#59
subscribing
#60
sub'ing
#61
What is the best way to convert Content Profile (D6) nodes to Profile data (D7)? If each user has just one profile we can convert data and use out of the box Profiles (D7). If there is no way to convert Content Profile nodes to Profile data I can create module for this type of migration.
#62
subscribing
#63
@furamag: I think creating a module, similar to the one that converts Drupal's old Profile module data to Content Profile data, would be helpful for people who have simple needs. I presume that you are referring to using fields to build a profile, rather than the pre-7.x Drupal core Profile module?
#64
@EvanDonovan: Yes, I mean I want to create module to migrate Content Profile (D6) to user fields (D7).
#65
In profiel 2, issue #893032: extension modules: profile_anonymous treats the same issue, from a Profile2 perspective.
It treats 'anonymous profiles', which can or cannot be attached to entities (e.g users)
D7 Content Profile can build upon Profile2 via the folowing steps
In Profile2:
- change fields profile-uid to profile-entity_id + profile-entity_type (an entity reference), so you can relate to 'any entity' (Orders, Universities, Terms, etc.)
In Profile Anonymous / Content Profile:
- Add a flag 'anonymous profiles possible' to the profile type. Setting this flag opens a UI, so you can:
-- create profiles via profile2/add/myprofile; the table 'profile' will only have fields profile-pid and profile-type set;
-- set the owner of the profile, setting the entity reference field in table 'profile'.
#66
subscribing
#67
subscribe
#68
subscribe
#69
subscribe
#70
sub
#71
subscribing
#72
fago: do you have some general pointers/vision on how to wrap profile2 around the node entity? I'm still kinda new to the whole entity stuff, but I do have a need for wrapping profiles around nodes and don't really know what would be a good start for coding this.
#73
subscirbing
#74
Any update on this?
I still like to use nodes as profiles. but I didn't find a way to relate profile2 with user in views/panels yet.
#75
#76
* subscribe *
I really need to have comments on the user profile. What would be the best solution to that? Is there anything I could do to to hasten the development?
I tried the following things already
- Installing Profile UX -> nothing gained
- Installing Profile 2 -> no extra benefits regarding comments, adjusting template works good enough
- Installing Guestbook -> cant get it to display without the tab, below the profile
- Manually inserting comments at the user profile (see below)
Manually inserting node view on user profile:
- Used core fields for the user profile itself
- Created a nodetype "profile-comments"
- Created a rule to autocreate a node for new users
- Built a view to show the full node, hiding the node itself with tpl and/or CSS
- Added a htaccess rule to redirect the profile nodes to the user profile (just to be sure)
Views doesnt show the comments anymore (grrr) since the last update though so i'm kinda stuck on that, and its still a workaround which isnt 100% integrated.
I'm almost to the point of remaking the site again in Drupal6, just to get this really important feature working again...
#77
The best way would imho be to work on #893854: Make comment module available for entity not for node which aims to implement comments on any entities.
#78
*bump* any update on this? Should an update to 7.x-dev provide profile comments or should people look into the issue shown above? That issue is marked as a duplicate of #731724: Decouple comment.module from node for further reference.
Another solution would be using facebook-style-statuses (http://drupal.org/project/facebook_status), though i'm not sure if it would do the same as what this module branch can/will provide...
#79
@dargno: Couldn't you add a node reference to a user entity, and then set up the tpl.php for the user profile to load the referenced node? You'd still need your code to auto-create a node though, probably.
#80
but what the community needed is easy upgrade path from content profile 6 to "the new solution for drupal 7"
alternatives are always welcome.
#81
Well a content profile is just a node with CCK fields, so the content profile itself can migrate like a regular CCK migration. And then to tie it to the user, you'd have to write some kind of module that linked it up via user reference. Or else do the Profile2/node wrapper method fago mentioned way earlier, but that would be harder to code.
As for me, this issue doesn't affect me, nor do I have the time to work on the code, nor am I a maintainer of this module - I'm just trying to provide advice.
#82
With the combination of rules i just set the creator of the node to the user that is created, and use the reference from there. Just got to hide the creation of new nodes from the users (dont know if permissions can do or if the rules cant create the page then anymore either).
Another thing is that there are many references to the user like when they create a node, or write a comment. I'd like those references to go to the proper page, hence i tried to connect the node to the user in a block, instead of the other way around...
A simple hook(?) to predefine and connect a node(type) to a profile and using that mainly (up to the developer) for comments would be the easiest solution, while if the developer of the sites wants to, any other CCK references can be used as well, like flickr photo's or any fields that are somehow not supported by the core profile module.
Would that be a solution? Or would checking out facebook-style-statuses or guestbook be a better solution?
- dargno
PS: can someone set the version of this issue to 7.x-dev? Its not in the list
#83
Its not in the list because there isn't a 7.x version. And presumably there won't be.
#84
but here in this issue, we have to conclude the followings:
1. Will Content Profile module have Drupal 7 version?
2. if not, what are the suggested solutions for the successful upgrade. whether it is profile2 node wrapper or node reference fields.
3. how we can achieve the same functionality that Content Profile provides now (show/hide fields from user registration, user to node one to one relationship restriction, tabs for profile editing/view etc.)
4. Profile2 Integration to views and panels.
5. Documentation/example/automatic migration module from content profile to profile2/profile2 node wrapper/node reference solution.
but my question is instead of having new module for profile2 node wrapper why content profile shouldn't provide this same functionality in its drupal 7 version.
#85
Not sure if this helps, but you can expose profile 2 fields in a content type using display suite and taxonomy entity index:
http://drupal.org/node/1195442#comment-4666022
You might also look at the Relation module:
http://drupal.org/project/relation
#86
@vinoth.3v: Well, it looks like there's no one currently who has the time to maintain Content Profile in a D7 version. They are volunteers, after all.
If we get confirmation of that from the maintainers of this module, and can answer some of the other questions you've helpfully laid out in a docs page, and then get the maintainers to link to that docs page on the project description, then I think we could mark this issue "closed (won't fix)", since that appears to be the proper status.
But we shouldn't do that until documentation of the proper migration path is made.
Also, I think another way to handle Profile2 in theory would be to load into a content pane in a Panel and then override the user/%user path with the resulting Panel. But I'm not sure if Profile2 exposes content panes - perhaps that would have to be written as a CTools plugin.
#87
This issue discusses Profile 2 and Panels:
http://drupal.org/node/1011370
#88
I need the profiles to be able to use comments and five star rating with the ability for guests to add the profiles of users and the actual user to later be able to claim that profile. I can't figure out how this will work with profile 2
#89
Profile2 is the successor of Content Profile. The way forward is clear, we need to write an upgrade path.
There are only two things to be discussed:
#90
I thought this topic was about porting content profile to D7, as a wrapper around profile2? For those people that still needed their profiles to be nodes.
#91
Well, technically, the topic was a question to Fago about his plans and whether he was going to port the module or offer an upgrade path. Back in #7, he indicated he thought it was worth upgrading but it doesn't look like he intends to be the one to do it. Since Sun isn't listed as a maintainer on this module, I'm reversing his unilateral decision to change the subject of the issue I started.
There are two issues here:
1) Those who don't have need of nodes in D7 need an upgrade path to Profile 2
2) Those who still need nodes in D7 need a port of Content Profile to D7, which makes sense as some sort of wrapper around Profile 2 rather than a completely different module.
I'm not volunteering to do either, just clarifying the issue. If we have volunteers for either of these, I suggest breaking off into a new issue to discuss concrete plans as this issue is more of a meta discussion.
Michelle
#92
Subscribing, I imagine content profile upgrade / migration is one of the biggest holds on D7 upgrades (it is for me at least)
#93
subscribing
#94
subscribe thx! upgrade from content profile to D7 profile2 ..
#95
Content Migrate should be able to successfully create D7 nodes from the D6 nodes, with all the fields intact. They won't be profiles but the data will be there. Then we need some way to transform a D7 node to a D7 profile, which hopefully would be a much simpler task than trying to tackle the whole D6 -> D7 upgrade path. Maybe something like create a D7 profile (even if it means that the site admin will have to do that part manually) then provide a place where the user can identify which content type contains the data that needs to be moved to the new profile. The act of moving the data from the node to the new profile would, I think, just be a matter of replacing the name of the entity in a couple of tables and then clearing the caches.
I don't have time to do it, and none of this is tested, but if it is framed this way maybe it is something some else could get working.
#96
Perhaps any news on how to upgrade from content_profile to profile2 please?
update to D7 is stalled as unable to convert 18 000+ profiles one-by-one :)
#97
#91 very well summarizes this issue.
>Well, technically, the topic was a question to Fago about his plans and whether he was going to port the module or offer an upgrade path. Back in #7, he indicated he thought it was worth upgrading but it doesn't look like he intends to be the one to do it.
Yep, I've currently no plans to work on that. Contributions are welcome, of course. #95 very well describes how the upgrade could/should work, thanks Karen.
ad #89:
>In which project should the upgrade code live? content_profile 7.x, or profile2, or...
I think we should put the upgrade code into content profile, so the upgrade path can keep the old nodes and turn them into nodes wrapping the corresponding profile2 entities. Afterwards people could turn content-profile off if they don't need nodes.
#98
Sorry to re-address this issue .. totally stuck here as cannot update to d7 and all development has stalled.
Has anyone perhaps found a solution (as no upgrade path available) via export/import of D6 content profile to D7 profile2 please?
I have tried:
http://drupal.org/project/feeds
no Profile2 fields available to import to, see http://drupal.org/node/1228062
http://drupal.org/project/migrate
only imports basic data (username, password, email), see http://drupal.org/node/1231404
Any concept on how to upgrade to D7 would be absolutely fabulous :) and thank you.
#99
I have a script that I wrote that incorporates a script I found that updates nodes from an XML file. That might be a possible route... Save all the content profile nodes out to an XML file and then pull them in D7 with the script. The main issue I see is my script assumes the nodes already exist because it's designed to update nodes. So you'd have to add in something that would create the nodes. It also would need to be adapted to use some sort of batching if you have a ton of users, I think.
If someone has the skills to take it the rest of the way, I can post what I have....
Michelle
#100
The route I've used in the past is creating batch job scripts that I've run with drush:
http://drupal.org/node/873132
#101
I've been working on this today because I need to pull some content profile info from the old D6 site into the new D7 site. This code is very site specific and will likely blow up if you throw thousands of users at it. I _just_ got it working and haven't done much testing because I need to leave. I'm putting this up here in case it helps anyone but don't expect to be able to just drop this into your site and have it work as is.
Step 1: Get Views Bonus Pack on D6 and make a view of Content Profile nodes that exports the fields to XML. Make sure you include the UID and that all your labels are lower case with no spaces in them. Export the XML dump to a file.
Step 2: Adjust the following code as needed to match your site and run it.
<?php
function lacc_menu() {
$items = array();
$items['import-people'] = array(
'menu_name' => 'main-menu',
'title' => 'Import people',
'page callback' => 'drupal_get_form',
'page arguments' => array('lacc_people_import_form'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
function lacc_people_import_form($form, &$form_state) {
$form = array(
'#tree' => TRUE,
'#attributes' => array('enctype' => 'multipart/form-data'),
);
$form['lacc_people_import_file'] = array(
'#type' => 'file',
'#title' => t('XML file containing the people results'),
);
// Submit button
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Import'),
);
return $form;
}
function lacc_people_import_form_submit($form, &$form_state) {
// Grab the file and save it to the temp directory.
$validators = array('file_validate_extensions' => array('xml'));
if ($file = file_save_upload('lacc_people_import_file', $validators, 'temporary://')) {
$people_file = drupal_realpath($file->uri);
}
lacc_import_people($people_file);
drupal_set_message('Import process complete.');
return;
}
function lacc_import_people($file_to_parse) {
// Load XML file and turn it into a PHP array.
$xml = new SimpleXmlIterator($file_to_parse, NULL, TRUE);
$namespaces = $xml->getNamespaces(TRUE);
$people_list = xmlToArray($xml, $namespaces);
// Strip off outer layer of array.
$people_list = $people_list['node'];
// Iterate through the people_list array and update each profile with the data.
foreach ($people_list AS $row_id => $person) {
$account_id = (int)$person['uid'][0];
$first_name = $person['first-name'][0];
// Load the profile for the user that coresponds with the row from the XML file.
// Create it if it doesn't exist.
$profile_type = 'profile_contact';
$profile = profile2_load_by_user($account_id, $profile_type);
if (empty($profile)) {
$profile = profile_create(array('type' => $profile_type, 'uid' => $account_id));
}
// Fill in the data from the XML file
$profile->field_profile_first_name['und']['0']['value'] = $first_name;
// Save the profile.
profile2_save($profile);
}
return;
}
function xmlToArray($xml,$ns=null){
/* Source: <a href="http://gaarf.info/2009/08/13/xml-string-to-php-array" title="http://gaarf.info/2009/08/13/xml-string-to-php-array" rel="nofollow">http://gaarf.info/2009/08/13/xml-string-to-php-array</a> in comment by Rasmus */
$a = array();
for($xml->rewind(); $xml->valid(); $xml->next()) {
$key = $xml->key();
if(!isset($a[$key])) { $a[$key] = array(); $i=0; }
else $i = count($a[$key]);
$simple = true;
foreach($xml->current()->attributes() as $k=>$v) {
$a[$key][$i][$k]=(string)$v;
$simple = false;
}
if($ns) foreach($ns as $nid=>$name) {
foreach($xml->current()->attributes($name) as $k=>$v) {
$a[$key][$i][$nid.':'.$k]=(string)$v;
$simple = false;
}
}
if($xml->hasChildren()) {
if($simple) $a[$key][$i] = xmlToArray($xml->current(), $ns);
else $a[$key][$i]['content'] = xmlToArray($xml->current(), $ns);
} else {
if($simple) $a[$key][$i] = strval($xml->current());
else $a[$key][$i]['content'] = strval($xml->current());
}
$i++;
}
return $a;
}
?>
#102
Thank you Michelle, most appreciated .. but unfortunately just did not understand as I ran it as a php file, then as a module as still no import form (sorry a little above my head here)
What am I going to do is upgrade to D7 with profile as a content type and hopefully (soon :) we will have an upgrade path to profile2.
#103
The code can't be run as is as it is specific to my site. You need to change the function names to your custom module, change the profile entity type, and change all the individual fields to your fields. I think that's it... I'm not looking at the code, now, though, so may have missed something.
MIchelle
#104
Thank you Michelle. I remember when we where in D5 with nodeprofile (to be able to create cck fields) as basic profile did not have selectable fields in views) .. we then moved to content_profile in D6, also which was also not easy to convert at the time. D5 and D6 moved user profiles to content types as the basic profile module had no cck capability.
After several years of building of profiles as a content type, we are back to the now going back to the needed cck fields on the profile module, yeah!
If this has been the transition from d5, d6 to d7 versions, the database of our users, the most important consideration of any site, the drive, how can this be changed without any ability to upgrade from content type back to profile.module?
We need the ability to convert as mentioned in Karen's #95, just putting this out there :) I will try for the moment how to figure out how to have your content profile attached when you visit your user (profile2) account.
Any suggestions, as always, most appreciated :)
#105
sub+
#106
subscribe
#107
sub
#108
+1
#109
Hi Michelle,
I've modified your code as needed for my site (test setup with D7.8), however I am unable to get menu item to show up.Do we need to create a form first or does that code block at the beginning generate a menu item, page, and form for us?
Figured out what the issue was, AND successfully migrated profile fields. ;-)
The code above doesn't have access callbacks/arguments.
In order to get this to work, you'll need to modify the first code block as follows:
<?php
function example_menu() {
$items = array();
$items['import-people'] = array(
'menu_name' => 'main-menu', // change this to the menu of your choice
'title' => 'Import people',
'page callback' => 'drupal_get_form',
'access callback' => 'user_access', // You'll need to add this
'access arguments' => array('access administration pages'), // And this
'page arguments' => array('example_people_import_form'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
?>
In addition, as mentioned by Michelle in a comment above, the code will have to be adjusted for your own custom module.
So make sure to change the module (hook) names.
Good luck!
Filmore
#110
I've decided to package up my custom module with all the specifics taken out to make it a it easier for others.
Make sure you generated and downloaded an XML file with Views.
Then the only things you need to add to this module for this to work are the fields you want to import from/to.
Check the comments in the .module file for specifics.
One thing to be aware of before you try to import is that if you have fields that are select lists, make sure to check the Allowed Values List is intact before attempting the import. I personally used the PHP Allowed Values List, and in all of my migrated fields (cck migration) the PHP code was missing so I had to add it manually from my production D6 site.
Hopefully this helps some people out, or even better maybe someone will expand on this and make a gui version for the masses.
Good luck!
Filmore
#111
A site I am working on uses a lot of node related functionality with profiles, like comments and ratings, etc. I have a dev site up where I have migrated all the D6 profile nodes to D7 nodes. I need to tie them to profiles.
I also need new users to be able to create these nodes on account registration.
I am stuck until an angel with more knowledge and talent than I can produce a node wrapper for Profile2.
#112
As I noted in http://drupal.org/node/560324#comment-4817254, I think the easiest way to do this would be to migrate the field data from D6 to D7 normally so you end up with D7 nodes, then move the fields to a different entity (either the user entity or a Profile 2 entity). I think the new Field Tools module could be the logical place to do it, I just posted a feature request at http://drupal.org/node/1349646.
#113
@ #82 dargno
I'm using D7
Did you get this fixed? You can use nodes as user profile by creating a view for that node and set the display type as page and show full content. You can use comments or anything else you would do with a node. You can also create a tab within the view("public profile", as example) which shows on the user account page. You filter this view by adding a contextual filter to the user id. I've done all of this.
You can also have a "My Profile" link in the user menu which shows this view to the current logged in user, where they can edit their own user profile info.
I will give you screen shots if you still need help with this.
#114
I like this method, but couldn't an user theoretically create as many profile nodes as they want?
#115
Yes and no--There are several ways to limit it to just one.
1. Do not expose a link anywhere which allows user to add new node
and/or
2. Rules--automatically create a profile when user registers.
and/or
3. Use node limit module here ( Node limit ) where you can limit the user to only create one node.
#116
I might add, I expect the automatic node title module will be needed also, since node titles cant be duplicates...this field can be hidden and create an automatic id when rules creates the node or when you allow the user to create their one node. Module is here Automatic Nodetitles
#117
@ #113 IwasBornToWin
Sorry for the late reply; I tried getting the node with the ruleset as explained at #82, though somehow after a while my view broke and it wouldnt show the comments nor the comment field. So i switched the whole thing around, and i'm using the nodes now. Since in this case I'm fetching the user data from LDAP, that information is read-only saved in the native user profile. All other information is stored in the auto-created node, which is editable by the user. With a slight adjustment of the node.tpl.php for the related content-type, I managed to show the profile fields of the owner of the node in there as well.
At some point i did indeed get the full node at the user profile as a view, though when the view somehow didnt show the comments anymore and i needed some fields to be editable and others not, I thought reversing it and just pointing to the node itself would be the easiest solution.
- Dargno
PS: I'm not sure but i can imagine that you can disable the rights for a user to create a particular node, where the ruleset still could... or is that linked? Otherwise the Node limit module would indeed be a nice addition.
PS2: I think i managed to set with rules the node title to the username, which is unique anyway, so no real need for another module for that i think?
#118
See imported view below. I am using with content type - profile. I didn't have to hack any code and the comments work fine. I don't think nodelimit mod is needed because in permissions I do not allow users to add this content type. Rules creates it when the user registers, so no need for user to ever add.
The user is able to edit any of the fields (If I allow). I used a couple fields from the user account(user picture) for the profile (because they work well with rules, dynamically) Other than that, I keep them separate.
I added new specific fields to the "profile" content type, specific to profile stuff (family photos, employment, etc.)
On my user account page I have tabs;
view | settings (edit) | profile | my content | etc.
$view = new view;
$view->name = 'my_profile';
$view->description = 'Profile viewable by other users. Accessed through the user account page(by a tab named "profile") when clicking on any username.';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'My profile';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Profile';
$handler->display->display_options['link_display'] = 'page';
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['view_mode'] = 'full';
$handler->display->display_options['row_options']['links'] = 1;
$handler->display->display_options['row_options']['comments'] = 1;
/* Relationship: Content: Author */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
$handler->display->display_options['relationships']['uid']['required'] = 0;
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
/* Field: Content: Edit link */
$handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
$handler->display->display_options['fields']['edit_node']['table'] = 'views_entity_node';
$handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
/* Field: Content: My categories of interest */
$handler->display->display_options['fields']['field_my_categories_of_interest']['id'] = 'field_my_categories_of_interest';
$handler->display->display_options['fields']['field_my_categories_of_interest']['table'] = 'field_data_field_my_categories_of_interest';
$handler->display->display_options['fields']['field_my_categories_of_interest']['field'] = 'field_my_categories_of_interest';
/* Field: User: Picture */
$handler->display->display_options['fields']['picture']['id'] = 'picture';
$handler->display->display_options['fields']['picture']['table'] = 'users';
$handler->display->display_options['fields']['picture']['field'] = 'picture';
/* Contextual filter: Content: Author uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'node';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'profile' => 'profile',
);
/* Display: Profile */
$handler = $view->new_display('page', 'Profile', 'page');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Profile';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['view_mode'] = 'full';
$handler->display->display_options['row_options']['links'] = 0;
$handler->display->display_options['row_options']['comments'] = 1;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: Content: Author */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['label'] = 'About me';
$handler->display->display_options['fields']['body']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['body']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['body']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['body']['alter']['external'] = 0;
$handler->display->display_options['fields']['body']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['body']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['body']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['body']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['body']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['body']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['body']['alter']['trim'] = 0;
$handler->display->display_options['fields']['body']['alter']['html'] = 0;
$handler->display->display_options['fields']['body']['element_label_colon'] = 1;
$handler->display->display_options['fields']['body']['element_default_classes'] = 1;
$handler->display->display_options['fields']['body']['hide_empty'] = 0;
$handler->display->display_options['fields']['body']['empty_zero'] = 0;
$handler->display->display_options['fields']['body']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['body']['field_api_classes'] = 0;
/* Field: Content: Edit link */
$handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
$handler->display->display_options['fields']['edit_node']['table'] = 'views_entity_node';
$handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
$handler->display->display_options['fields']['edit_node']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['edit_node']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['edit_node']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['trim'] = 0;
$handler->display->display_options['fields']['edit_node']['alter']['html'] = 0;
$handler->display->display_options['fields']['edit_node']['element_label_colon'] = 1;
$handler->display->display_options['fields']['edit_node']['element_default_classes'] = 1;
$handler->display->display_options['fields']['edit_node']['hide_empty'] = 0;
$handler->display->display_options['fields']['edit_node']['empty_zero'] = 0;
$handler->display->display_options['fields']['edit_node']['hide_alter_empty'] = 1;
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: Content: Author uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'node';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['uid']['exception']['value'] = '';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['uid']['default_argument_skip_url'] = 0;
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['uid']['break_phrase'] = 0;
$handler->display->display_options['arguments']['uid']['not'] = 0;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'profile' => 'profile',
);
$handler->display->display_options['path'] = 'user/%/profile';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'Profile';
$handler->display->display_options['menu']['weight'] = '-5';
$handler->display->display_options['menu']['name'] = 'user-menu';
$handler->display->display_options['tab_options']['weight'] = '0';
$handler->display->display_options['tab_options']['name'] = 'user-menu';
#119
I'm trying to upgrade a single user profile (using content_profile module) from D6 to user entity in D7.
As suggested I installed the profile2 module, among others, before running drush -y content-migrate-fields.
All fields are migrated to D7 (not sure if profile2 is actually needed for this), but the fields are neither available on the core user entity, neither on the profile2 Main profile.
Is there anyone out there that wrote some code to actually migrate the fields to user entity and the existing field data to the appropriate users?
#120
Just as an FYI since I was the one that created this issue: I'm going to unfollow it. I don't need this anymore and don't need to follow the conversation. Probably no one would care but I don't want someone to assume I'm reading because I created the issue and then think I'm ignoring them.
Michelle