Hi,

It would be cool to add drush support for generating (and re-generating) realnames. In particular, I need this for a current project for a migration.

Patch coming up..

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kpa’s picture

Status: Active » Needs review
FileSize
3.19 KB

Patch attached.

tkuldeep17’s picture

Hi kpa,

Good patch.. It is working fine. It can ported to module.

Thomas Bosviel’s picture

Status: Needs review » Reviewed & tested by the community

It works. Thanks!

hass’s picture

Status: Reviewed & tested by the community » Needs work

There is at least one typo in a string. Loading all users at once can run into an out of memory. How do other modules handle this? Isn't there a batch mode in drush so we may run 5.000-10.000 updates only at once? The rest looks good to me.

kpa’s picture

Hi hass,

Rather than just saying "there is a typo", can you point out what the typo is please? I can't see any typos...

Also, loading all users at once should be fine for the majority of use-cases. You'd need to have a fairly large number of users for this to cause memory issues, though obviously that depends on number of fields, levels of caching, etc etc. max_execution_time over CLI is normally set to 0, so there aren't any timeout issues with this.

Thanks

hass’s picture

+++ b/realname.drush.inc
@@ -0,0 +1,108 @@
+      'drush rrc 3 4 5 6 7' => 'Recreate realnems for users  with UIDs 3, 4, 5, 6, and 7.',

Sorry, I was on mobile without dreditor

Also, loading all users at once should be fine for the majority of use-cases. You'd need to have a fairly large number of users for this to cause memory issues, though obviously that depends on number of fields, levels of caching, etc etc. max_execution_time over CLI is normally set to 0, so there aren't any timeout issues with this.

Not sooo many... I ran into a lot of memory issues in Linkchecker when I've mass-loaded. It should be quite easy to add a batch so we should better be safe than sorry. Try to test with 1.000.000 users.

alan-ps’s picture

Really good thing. I've improved previous patch in accordance with the remarks above.