From dww's comment at http://drupal.org/node/143748#comment-243164:
it's evil that this profile is forking generate-content.php. in fact, it just nailed me on a test site, where the include_once "generate-content.php"; was finding an old copy from devel, instead of the one in here, and that was ignoring what we were asking it to do and going off to generate 10K nodes on its own. :(
i'd rather we just required devel module (which we do already), and then just used devel_generate.module's functions directly (e.g. devel_create_nodes()), instead of maintaining our own fork of this code.
He is so right. :)
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | remove_generate_3.patch | 4.33 KB | hunmonk |
| #8 | remove_generate_2.patch | 4.73 KB | hunmonk |
| #7 | remove_generate_1.patch | 5.23 KB | hunmonk |
| #5 | remove_generate_0.patch | 5.12 KB | hunmonk |
| #4 | remove_generate.patch | 4.75 KB | hunmonk |
Comments
Comment #1
dww+1. ;)
Comment #2
dwwsee http://drupal.org/node/144695. once that lands, we can clean-up the user generation code in here and remove generate-users.php completely.
Comment #3
hunmonk commentedhttp://drupal.org/node/159533 would also allow us to get rid of our custom solution for generating content.
Comment #4
hunmonk commentedfirst crack. totally untested.
Comment #5
hunmonk commentedattached patch fixes up a few problems with my first effort. this has been tested against mysql and postgres, and it functions perfectly as far as i can tell.
Comment #6
dwwThis is a great start, and we're almost there. However...
A) This shouldn't include devel_generate.module as soon as http://drupal.org/node/160557 lands. That's just silly.
B) You introduced a nasty bug: you wiped out all the custom, special users since you call devel_generate_users() with the $kill argument set to TRUE. :(
C) It's unclear to me why you reversed the order of the $users array. It's a list of users and the corresponding roles they belong to. What if we want to add other roles to certain users easily? For example, for real on d.o, everone in the cvs admin role is also in the site maintainer role. That would have been easy to represent with the old code, and is much harder now.
D) This hunk has nothing to do with the rest of this patch:
Yes, it's a trivial fix, but I really prefer not to throw in unrelated changes in patches and issues. That sort of fix doesn't even belong in a patch/issue IMHO, that could just be committed directly.
Comment #7
hunmonk commentedin response:
a. correct. but we needed http://drupal.org/node/160557 first, which is now committed. attached patch removes that silly-ness...
b. just need to move the code back, then. attached patch corrects
c. if you'll look at the user creation code now, i'm using user_save(), which we should be using. in D5, the roles are pulled by using array_keys() in user_save(), thus the flip.
d. postgres bombs because it's case sensitive. please don't make me roll another patch for a sincle character fix :)
Comment #8
hunmonk commentedsorry, didn't fully understand C. attached patch corrects that, and doesn't contain the typo fix, either...
Comment #9
hunmonk commentedmoved the random user creation back after the others -- we don't need to $kill the other users, as this is always a fresh install.
consolidated the line of code that builds the user's roles.
Comment #10
dwwPerfect, thanks!
Comment #11
dwwhunmonk committed this but forgot to mark it fixed (even after being reminded). ;)
Anyway, thanks again for the work on this, it's a great improvement.
Comment #12
(not verified) commented