Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This Cookbook shows, how you can avoid to import a user in case of errors in the e-mail address and then to add a notice in the drupal error-log (dblog). It adds this behavior to the module A Wusel Migration (http://drupal.org/node/1285276).
The Profile2 module integrates with Views to allow listing of users with their profile information.
While you can create views directly using the a Profiles type view, most views will start with a User type view. To add Profile2 fields to a User view, you need to add a relationship for User: Profile.
If you are designing a custom template for your user profile pages and are using the Profile2 module, you probably are looking to add your custom fields to the user-profile.tpl.php template. Here is how this can be accomplished.
This assumes that you have a Profile2 profile type called my-profile. You may easily load your fields into your custom user-profile.tpl.php by printing them like this:
In order for the Community Media Profile to work the following needs to occur when the Community Media Profile module is installed OR when the Community Media Theme is updated.
At the command line, go to profile directory...profiles/[your_starterkit]/modules/contrib-cm/cm_profile/templates
Copy user-profile.tpl.php to the Community Media Theme templates directory
The directory is at . . ./sites/all/themes/cm_theme/[name-of-your-theme]/templates
You will likely need to clear the cache
If you update the Community Media Theme, you'll find that its templates directory removes the user-profile.tpl.php file.
This Cookbook shows, how you import one CSV file into a Drupal 7 site, creating new users, each with Profile2 fields.
The trick is to create two separate migrations from one source. The first creates the users, the second creates the profiles.
The second migration connects up the profiles it creates with the users that now exist by mapping the source unique key, MID, to the user uid. This is achieved by applying the line $this->addFieldMapping('uid', 'MID') to the code.
Remark
The intention of this cookbook is, with detailed notes on this page and comments in the code to explain the function of each component of this migration as a working demo. For your first try use a fresh installed 'drupal 7 with default profile' and then start with step 1.