I saw in http://drupal.org/node/1947324 that you should be able to migrate the body from a profile node, does the same work for the title? I tried mapping field_<type_name>_title to a D7 user field but it didn't seem to work.

Comments

mikeryan’s picture

Category: support » feature

Not at the moment, looks like we have to hack in support for this as we did for the body...

mikeryan’s picture

Status: Active » Needs review
StatusFileSize
new2.53 KB

Doesn't look too hard, please give this a try.

mikeryan’s picture

Status: Needs review » Fixed

Had a chance to actually test it, and that patch was incomplete. I've now committed a working implementation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bkerwin’s picture

Thanks Mike. I grabbed the latest dev version and I see code for it in d6/d6.inc. It doesn't seem to work for me; I should just be able to do:

$this->addFieldMapping('field_profile_name', 'field_profile_title');

Where 'profile' is the Content profile content type on the source and field_profile_name is my destination field, correct?

bkerwin’s picture

Status: Closed (fixed) » Needs review
mikeryan’s picture

Status: Needs review » Postponed (maintainer needs more info)

"needs review" means there's a patch that needs review, "active" is what you set a support request to if you're expecting help.

If you go to the detail page for your user migration, on the Source tab, you should see 'field_profile_title' and 'field_profile_body' along with any CCK fields from the profile type (assuming the D6 site has titles and bodies enabled on that content type) - are you not seeing them?

bkerwin’s picture

My bad on the issue status, still learning my way around.

I actually set up my migrations before the new UI for migrate_d2d existed so when I go there now it's asking for db credentials etc. This is what I get by doing drush mfs on this migration task (Users):

Somewhat relatedly to the other issue I have (https://drupal.org/node/1989466) the subfields for the location field don't appear which is probably why I can't get that to work.

Per-user comment display mode         mode
Per-user comment sort order           sort
Obsolete comment configuration        threshold
User ID                               uid
Email address                         mail
Username                              name
Password                              pass
Status                                status
Registered timestamp                  created
Last access timestamp                 access
Last login timestamp                  login
Picture                               picture
Signature                             signature
Signature format                      signature_format
Timezone                              timezone
Language                              language
Default theme                         theme
Init                                  init
Data                                  data
Image                                 field_profile_image
Image subfield                        field_profile_image:list
Biography                             field_profile_bio
Biography subfield                    field_profile_bio:format
Newsletter Opt-in                     field_newsletter_opt_in
Things I share                        field_profile_things_share
Website                               field_profile_website
Website subfield                      field_profile_website:title
Website subfield                      field_profile_website:attributes
Location                              field_profile_location
Path alias                            path
Roles                                 roles
Example Content: America/Los_Angeles  timezone_name
mikeryan’s picture

Don't go through the import wizard, go to the Migrate dashboard, click on the group name, then click on the name of the specific migration to get to its details page.

I can't explain why you're not seeing the profile title there, I would double check the content type's D6 configuration and make sure the title is enabled there. If that looks OK, all I can suggest is debugging the code to see why migrate_d2d isn't identifying the title.

bkerwin’s picture

Ah ok.. when I go to admin/content/migrate/groups/default, I get the following messages in the error area:

Notice: Trying to get property of non-object in DrupalVersion6->populateSourceFieldInfo() (line 108 of C:\wamp\www\shareable7\sites\all\modules\migrate_d2d\d6\d6.inc).
Notice: Trying to get property of non-object in DrupalVersion6->populateSourceFieldInfo() (line 112 of C:\wamp\www\shareable7\sites\all\modules\migrate_d2d\d6\d6.inc).<code>

Looking at that file, that's where it's checking for the title and body. The title and body are definitely enabled in the source content type.

The detail page for the group shows pretty much the same info I gave before with some additional details. Same list of fields, no field_profile_title or field_profile_body (the source content type is Profile).

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Active
shaundychko’s picture

Status: Active » Needs review
StatusFileSize
new1.48 KB

I removed the has_body condition from the following since there's already a test for has_body a few lines later. The attached patch fixes the error in comment #10 which is a result of having a content_profile node type which has the body disabled, in which case $type_info is NULL since the content_profile type doesn't satisfy the has_body condition. This also fixes getting the content_profile node title since, in the case where the body is disabled, but the title is still used, $type_info would nevertheless still be NULL since, again, the has_body condition fails. Furthermore, it turns out that in my case using the content_profile node type doesn't sufficiently 'uniquify' the title field, so I appended '_node_type' to the $bundle name to enhance the uniqueness. There's also a check that $type_info is an object.

        $type_info = Database::getConnection('default',
                                         $this->arguments['source_connection'])
                         ->select('node_type', 'nt')
                         ->fields('nt', array('has_title', 'title_label',
                                              'has_body', 'body_label'))
                         ->condition('type', $bundle)
                         ->condition('has_body', 1)
                         ->execute()
                         ->fetchObject();
bkerwin’s picture

Thank you very much Shaun! This patch did the trick and I have the profile titles migrating perfectly now.

igorik’s picture

Status: Needs review » Reviewed & tested by the community

patch in #12 is working for me, please add it into dev version at least,
it is from July 19th....

pianomansam’s picture

Patch from #12 works for me as well!

oadaeh’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.5 KB

I've modified the patch in #12 to check if the title and body are empty before performing their operations.

mikeryan’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed, thanks.

  • Commit b2b0e4d on 7.x-2.x by mikeryan:
    Issue #1988616 by ShaunDychko,oadaeh: Fix handling of content_profile...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.