Similar to contrib Migrate we need a destination option that allows passwords that comes in with MD5 hashing to be salted and rehashed in a Drupal >=7 way.

Few notes:

Comments

claudiu.cristea’s picture

StatusFileSize
new2.24 KB

A user migration wanting to rehash MD5 passwords will need to use the new entity_user destination plugin and set the md5_passwords to true:

destination:
  plugin: entity_user
  md5_passwords: true
claudiu.cristea’s picture

Status: Active » Needs review
claudiu.cristea’s picture

StatusFileSize
new14.74 KB

Here's a new patch after IRC discussion with @chx.

I added also a simpletest. Why not phpunit test? Because we need to full test also the later password rehashing when user is logging in.

chx’s picture

Thank you so much! This really is great. I have two problems: being logged in should be checked by $this->assertTrue($this->drupalUserIsLoggedIn($account));. The other is the test module -- all the other tests are using Drupal 6 dumps, why we can't do that? I mean, sure, we don't yet have a d6 user migration but you could start it. I understand those are migrate_drupal tests, well, for example, the entity destination is only tested by those too so I would see no problems adding a migrate_drupal test for this as well. You could have a d6_user migration doing the basics, uid,name,mail and of course password and then we will finish it later. Thanks again.

claudiu.cristea’s picture

StatusFileSize
new8.84 KB

OK. Then the test will go in the future d6_user migration as we have there the dump and we can test all together.

chx’s picture

Status: Needs review » Fixed
StatusFileSize
new2.41 KB

Thanks, I committed this with some small changes. See attached interdiff.

claudiu.cristea’s picture

Indeed, we need that additional check.

I changed also docs at https://drupal.org/node/2174881 and added a new subpage for this new plugin at https://drupal.org/node/2183357

Status: Fixed » Closed (fixed)

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