right now, the code that actually generates the random users lives directly in the form submit handler for the devel_generate.module's UI ( devel_generate_users_form_submit() to be precise). that's lame. there should be a devel_create_users() function in devel_generate.inc which a) would be called from the submit handler, but b) could be called from other places, too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
FileSize
3.13 KB
dww’s picture

Category: task » bug
FileSize
3.17 KB

forgot to mention, my previous patch fixes a few bugs, too:

  1. this is bogus: db_next_id('{users_uid}');, should be db_next_id('{users}_uid');
  2. this is bogus: db_query("UPDATE {sequences} SET id = %d WHERE name = 'users_uid'", $uid); for two reasons: a) 'users_uid' isn't being prefixed and b) the whole thing doesn't belong there, now that this function is properly using db_next_id()...
  3. for ($i = 2; $i <= $num; $i++) { is a hold-over from when we were hard-coding that we always nuked everything and started after uid 1. so, previously, we'd always generate N-1 users when N were requested, even though we'd lie and say we created all N of them. ;) try it yourself and ask the existing thing to generate you 1 user...

speaking of which, i re-rolled to use format_plural() for that drupal_set_message. ;)

webchick’s picture

FileSize
2.9 KB

Much easier to use now, but we really need some kind of indication of what that asterisk means (or else use a different marker -- elsewhere in core, * means 'required').

Here's a patch that prepends a simple description to the block:

* = user who may switch back

same font style as the description for the user search box.

webchick’s picture

sigh. ;) replied to wrong issue. ;)

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Excellent improvement. Tested and works great. RTBC. :)

dww’s picture

Status: Reviewed & tested by the community » Fixed

thanks for the review, webchick. committed to DRUPAL-5 and HEAD (which took a little porting, since the patch didn't apply cleanly).

Anonymous’s picture

Status: Fixed » Closed (fixed)