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.
Scenario - I have a file migration which grabs user avatars and creates file objects for them. My user migration then uses sourceMigration() to get those fids into $account->picture. Works nicely on initial import, but running with --update clears the pictures. This is because user_save(), on update only (not insert) expects $account->picture to be a file object rather than a fid. MigrateDestinationUser needs to deal with this.
Comments
Comment #1
mikeryanCommitted to D7.
Comment #2
mikeryanNot relevant to D6.
Comment #3
mototribe CreditAttribution: mototribe commentedHi Mike,
I'm using the 7.2.2 version and am trying to update the user picture (after I migrated the image first). It doesn't update the "picture" column in the users table. I tried the dev version but ran into errors and went back to 7.2.2.
I copied the extra code from from the dev version of plugins/destinations/user.inc but still no success.
When I add the fid manually to the users.picture field the picture shows up ok.
I followed the examples and it's updating other fields, just not the picture field. Here is the relevant code:
Any help is appreciated. Thanks!
UWE
Comment #4
mototribe CreditAttribution: mototribe commentedgot a workaround - I added this to the image import migration:
thanks to http://drupal.org/node/1120136#comment-4320404